Hello, I am trying to right a select function in php to call from a mysql database: $sql= "SELECT * FROM `table` WHERE 'row' = '$name' " ; $result=mysql_query($sql) or die(mysql_error()); I keep getting the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 i have tried removing the single quotes...changing which values has quotes, where the quote appears, but nothing works.... any help would be greatly appreciated.... Thanks in advance
Try changing ' to ` at the row part. Either use backticks for table and column names or use nothing. $sql= "SELECT * FROM `table` WHERE `row` = '$name' " ; or $sql= "SELECT * FROM table WHERE row = '$name' " ;
thank you jestep......it worked...i appreciate the help... jayshah, i didnt try your code, since it worked i don't want to mess it up......but thank you as well...