Skip to content
Advertisement

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 near

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 using mysql_real_escape_string

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=0;” when it’s

Using fopen and str_replace to auto fill a select option

I have this file ‘gardens.php’, which pulls data from a table called ‘generalinfo’ and I use fopen to send that data to a file called ‘index.html’. Here is the issue, only one option is filled. I have a demo running here Garden Demo <– this is a new updated page and location, there are more errors than I have locally

How do I set the selected item in a drop down box

Is there any way to set the selected item in a drop down box using the following ‘type’ code?