Re: [PHP] Why doesn't this simple query work?

2001-07-26 Thread Christian Reiniger
On Wednesday 25 July 2001 23:05, Seb Frost wrote: Thanks for the suggestion but it's too ugly for me :-) I'll just stick with using '. I don't forsee a problem. $query = SELECT shoodID FROM shoots WHERE location='$location'; wget

RE: [PHP] Why doesn't this simple query work?

2001-07-25 Thread Boget, Chris
Driving me mad. Works if I put a string in quote marks instead of the variable $location. $result = mysql_query(SELECT shootID FROM shoots WHERE (location=$location)); This should work shouldn't it? If it's a problem with the variable being embedded in the query what's the easiest way to

Re: [PHP] Why doesn't this simple query work?

2001-07-25 Thread Jon Yaggie
hmmm i think you need to always have quotes around string regardless of if they are variables . . . $result = mysql_query(SELECT shootID FROM shoots WHERE (location='$location')); - Original Message - From: Seb Frost [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Thursday,

Re: [PHP] Why doesn't this simple query work?

2001-07-25 Thread Moriyoshi Koizumi
IMHO $query = SELECT shoodID FROM shoots WHERE location=\$location\; and even $query = SELECT shoodID FROM shoots WHERE location='$location'; sometimes cause SQL Syntax Error, because the variable $location may contain quote characters (')()... since i experienced the same thing i've been

RE: [PHP] Why doesn't this simple query work?

2001-07-25 Thread Brave Cobra
True, that's because mySQl doesn't understand it without the signle quotes, or any descent database for that matter. BC -Original Message- From: Jon Yaggie [mailto:[EMAIL PROTECTED]] Sent: woensdag 25 juli 2001 22:12 To: [EMAIL PROTECTED] Subject: Re: [PHP] Why doesn't this simple query

RE: [PHP] Why doesn't this simple query work?

2001-07-25 Thread Lawrence . Sheed
PROTECTED]] Sent: July 26, 2001 4:59 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Why doesn't this simple query work? IMHO $query = SELECT shoodID FROM shoots WHERE location=\$location\; and even $query = SELECT shoodID FROM shoots WHERE location='$location'; sometimes cause SQL Syntax Error, because

[PHP] how do you write queries in php codes? (was Re: [PHP] Why doesn't this simple query work?)

2001-07-25 Thread Moriyoshi Koizumi
yes, both of yours make the same result too, and are clean :-) and i wonder what the best way is, to put queries into php code... there's a more complicated sample, $a=addslashes($a); $b=addslashes($b); $c=addslashes($c); if( $another_table ) { $another_table=','.$another_table; } $query =

RE: [PHP] how do you write queries in php codes? (was Re: [PHP] Why doesn't this simple query work?)

2001-07-25 Thread Lawrence . Sheed
] Subject: [PHP] how do you write queries in php codes? (was Re: [PHP] Why doesn't this simple query work?) yes, both of yours make the same result too, and are clean :-) and i wonder what the best way is, to put queries into php code... there's a more complicated sample, $a=addslashes($a); $b