Hi All
Another msql problem that has been driving me mad.
I'm trying to pass a variable in the Select statement to return the results from a table based on a particular row...should be simple right? Well I have spent all day on this...and I've got nowhere...Perhaps someone can help me. Here is my statement below with a few variations that I have tried:
$result=mysql_query("SELECT * FROM subscribers WHERE list_name='".$list."'")or die(mysql_error());
$result=mysql_query("SELECT * FROM subscribers WHERE list_name='$list'")or die(mysql_error());
$result=mysql_query("SELECT * FROM subscribers WHERE list_name=$list")or die(mysql_error());
$result=mysql_query("SELECT * FROM subscribers WHERE list_name=".$list."")or die(mysql_error());
I have a connection to the database, I am passing the variable through the URL and using $HTTP_POST_VARS just to make sure.
I can use the exact statement fine for DELETE, UPDATE etc. I've echoed the query result and have found that the statement is working. However, I either get nothing returned or Unknown column '' in 'where clause', which I don't understand why it is looking at my variable as a column.....
If anyone can help me that would be great
thanks Nigel