Forum Moderators: coopster

Message Too Old, No Replies

Unknown column - which is actually there

         

mschultem

9:27 am on Mar 2, 2007 (gmt 0)

10+ Year Member



hi
i have a problem with the following code:


$query = "SELECT * FROM demography WHERE uid=".$pid;
$result=mysql_query($query)
or die ("Error - ".mysql_error()."");

$pid comes from a GET method
demography is the right name for the db, uid is the i right name for a table in demography

it actually works when i replace $pid with one of the values in uid ...
any suggestions?

thanks a log
m

dreamcatcher

9:32 am on Mar 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi mschultem,

Try enclosing your var in single quotes:

$query = "SELECT * FROM demography WHERE uid='$pid'";

dc

jatar_k

3:46 pm on Mar 2, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



can I just clarify, I assume by this

demography is the right name for the db, uid is the i right name for a table in demography

you mean

demography is the right name for the table, uid is the i right name for a column in demography

just checking

also, what is the exact error that is returned by your die?

dreamcatcher

6:55 pm on Mar 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



demography is the right name for the table, uid is the i right name for a column in demography

Good catch j, I bet that is indeed the problem. Wrong naming conventions.

dc