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
> 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
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
]>
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("
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
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
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
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 =
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+
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
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
11 matches
Mail list logo