Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Cannot manage to use forwardslashes in mysql select command
Old 01-23-2006, 01: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
__________________

Please login or register to view this content. Registration is FREE
secure and fully automated computer data backup for small and medium sized companies.


Please login or register to view this content. Registration is FREE
hamish is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-23-2006, 06:25 PM
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
What is "My_Documents"? What does $backupname contain?
__________________

Please login or register to view this content. Registration is FREE
- The world at your fingertips
• Share your city with the world

--
Please login or register to view this content. Registration is FREE
neroux is offline
Reply With Quote
View Public Profile
 
Old 01-23-2006, 09:35 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
$backupname = "/" . "My_Documents" . "/";
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
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.27536 seconds with 12 queries