Skip to content

Tag: select

SELECT id FROM table_name WHERE column = $variable

I’m trying to retrieve the id number of a record to use as a variable elsewhere. I only want the id from a record that has a particular value in another column. here is my code: When I test I get: SQL syntax; check the manual that corresponds to your MySQL server versi0on for the right syntax to use nea…

why select option value if zero post empty

I am sorry bad English. I have a select menu option value problem: I am if select value=”0″ option and this post, it retuns the value with no problem. But, when I use value = 0 save mysql table, this value not 0 this return empty. This value saving column type integer? What is problem? I am not us…

PHP & MySQL: How can I use “SET @rank=0;” in $query=

In my PHP file, I use this line to pull data from my mySQL database: If I check the SELECT statement in phpMyAdmin’s SQL window (without $query= ) it works fine. But, if I use it in PHP, then I get an error. It doesn’t like the “SET @rank=0;” bit. Is there a way to use “SET @rank…