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

2001-07-25 Thread Seb Frost
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 o

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

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

2001-07-25 Thread Jon Yaggie
uot;php-general" <[EMAIL PROTECTED]> Sent: Thursday, July 26, 2001 3:10 AM Subject: [PHP] Why doesn't this simple query work? > Driving me mad. Works if I put a string in quote marks instead of the > variable $location. > > > $result = mysql_query("SELECT shootID

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

2001-07-25 Thread Seb Frost
]> To: "php-general" <[EMAIL PROTECTED]> Sent: Thursday, July 26, 2001 3:10 AM Subject: [PHP] Why doesn't this simple query work? > Driving me mad. Works if I put a string in quote marks instead of the > variable $location. > > > $result = mysql_query("

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 b

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

2001-07-25 Thread Seb Frost
Thanks for the suggestion but it's too ugly for me :-) I'll just stick with using '. I don't forsee a problem. - seb -Original Message- From: Moriyoshi Koizumi [mailto:[EMAIL PROTECTED]] Sent: 25 July 2001 21:59 To: [EMAIL PROTECTED] Subject: Re: [PHP] Why doesn

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

2001-07-25 Thread Brave Cobra
PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Thursday, July 26, 2001 3:10 AM Subject: [PHP] Why doesn't this simple query work? > Driving me mad. Works if I put a string in quote marks instead of the > variable $location. > > > $result = mysql_q

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

2001-07-25 Thread Lawrence . Sheed
Original Message- From: Moriyoshi Koizumi [mailto:[EMAIL 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 =

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 http://foo.bar/yourscript.php?location=xy';delete+from+

[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 = "sel

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
y 26, 2001 10:28 AM To: [EMAIL PROTECTED] 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