I'm doing this SELECT LOAD_FILE("/home/user/domains/example.com/public_html/robots.txt") AS tmp FROM tmpTable
but it returns NULL. How can I check if this is because I haven't got the FILE privilege or if it's something else? MySQL won't give an error. (I'm using PHP)
Anyone that has experience with LOAD_FILE, tell me about that function:)
<?php
$result = mysql_query('SELECT LOAD_FILE("/home/user/domains/example.com/public_html/robots.txt") AS tmp FROM tmpTable') or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
var_dump( $row['tmp'] );
}
Looks like some versions of MySQL on Linux distributions have a bug with the LOAD_FILE function. Here is the thread. At the very end of the thread looks like there might be a workaround.
EDIT:
Since you're on a shared host, looking at the functionality you want could you just read the file instead? Using the file() should read the file into an array format.