Reply
Cannot manage to use forwardslashes in mysql select command
Old 01-23-2006, 12:17 PM Cannot manage to use forwardslashes in mysql select command
Skilled Talker

Posts: 79
Trades: 0
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
__________________
http://www.iskm.com/backup/ secure and fully automated computer data backup for small and medium sized companies.

FREE OFFSITE BACKUP
hamish is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 01-23-2006, 05:25 PM
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
What is "My_Documents"? What does $backupname contain?
__________________
CityPics.org - The world at your fingertips
• Share your city with the world

-- Meet your Meat
neroux is offline
Reply With Quote
View Public Profile
 
Old 01-23-2006, 08:35 PM
chrishirst's Avatar
Super Moderator

Posts: 26,536
Location: Blackpool. UK
Trades: 0
Code:
$backupname = "/" . "My_Documents" . "/";
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Cannot manage to use forwardslashes in mysql select command
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.08629 seconds with 13 queries