Re: [PHP] select statement with variables ???

2005-12-21 Thread Robin Vickery
On 12/21/05, Anasta [EMAIL PROTECTED] wrote: Can someone tell me why this select is wrong please---ive tried everything. the $cat is the tablename . You've tried *everything* ? Why do you think it's wrong? Did you get an error message of some kind? What do you see if you echo $query? Are the

RE: [PHP] select statement with variables ???

2005-12-21 Thread Jim Moseby
Can someone tell me why this select is wrong please---ive tried everything. the $cat is the tablename . $query= SELECT title FROM $cat WHERE id='$id'; Apparently, either $cat or $id is not the value you think it is. First, I would try changing $result=mysql_query($query); to

RE: [PHP] select statement with variables ???

2005-12-21 Thread Jay Blanchard
[snip] $query= SELECT title FROM $cat WHERE id='$id'; [/snip] echo $query; // does it look right to you? Alway throw an error when in question if(!($result = mysql_query($query, $connection))){ echo mysql_error() . br\n; exit(); } My bet is that you need to concatenate $query = SELECT

Re: [PHP] select statement with variables ???

2005-12-21 Thread Jochem Maas
side-question Jay how come you though concating would give a different result to interpolation? /side-question Jay Blanchard wrote: [snip] $query= SELECT title FROM $cat WHERE id='$id'; [/snip] echo $query; // does it look right to you? Alway throw an error when in question if(!($result =

RE: [PHP] select statement with variables ???

2005-12-21 Thread Jay Blanchard
[snip] side-question Jay how come you though concating would give a different result to interpolation? /side-question [/snip] It is not really a different result, it is just something that I am in the habit of doing. The concat or not to concat question has fueled many a holy war. I concat,

Re: [PHP] select statement with variables ???

2005-12-21 Thread Jochem Maas
Jay Blanchard wrote: [snip] side-question Jay how come you though concating would give a different result to interpolation? /side-question [/snip] It is not really a different result, it is just something that I am in the habit of doing. The concat or not to concat question has fueled many a