Hey
I'm trying to get some data from a database, but I'm having a problem where the piece of data I'm service for will have b
Code:
$backupname = "/" . My_Documents . "/";
$query = "SELECT date_today FROM connections WHERE username = '$username' AND directory = '$backupname' "; <-- HERE IS THE PROBLEM
$result = mysql_db_query (diamondbackup, $query, fn_db_link());
$row = mysql_fetch_row( $result );
echo $row[date_today];
Looks at the logs, the folling command was run:
SELECT date_today FROM connections WHERE username = 'luachmhor' AND directory = '//' <-- it deson't put in the variable.
If i remove the quotation marks round the $backupname variable, I get this error:
Warning: Wrong parameter count for mysql() in /home/hamish/public_html/diamondbackup.co.uk/admin/functions/fn_report.php on line 215
and this command is run:
SELECT date_today FROM connections WHERE username = 'luachmhor' AND directory = /My_Documents/
WHy can I not put quotation marks round the variable when it has forward slashes?
Thank you in advance
hamish
|