Php/sql form population values not submitted

Hi have a quick question. Currently I am filling a form with data from a sql query. So for instance they select item number two and the form is filled with the data for item 2 from the data base. I then wish to be able be able to press my update button and have the data that is in the …

via Sql Databases Development » Search Results » ajax:

Php/sql form population values not submitted

Hi have a quick question. Currently I am filling a form with data from a sql query. So for instance they select item number two and the form is filled with the data for item 2 from the data base. I then wish to be able be able to press my update button and have the data that is in the form submitted so that if it is changed in the form it changes in the data base. for example:
item 1 is selected from the drop down list
enter is pressed
the page is refreshed and the form is populated with the data from the sql statement in the first submit
^^^ this works
I know have the info in the form and want to be able to hit the ubdate button so the old data is passed or type in in values and sub it. The problem is the variables and data that are stored in the form are not passed
Here is the page source
enter code here














…………………………………….

Misread the post, sorry. Re-evaluating…
2 Suggestions to try, one is for coding practice, if possible dont use text as the WHERE, assign an ID and pass that instead. You have to take into account case, etc if you use text.
In your HTML, add spaces. name=”CurrentLevel”id=”CurrentLevel”value=””
…………………………………….

I don’t see where the $_SESSION[‘item’] variable is set/populated in your code, but I would store that value in a HIDDEN INPUT in your form.
Form code:



$work = mysql_query(“
SELECT *
FROM Inventory WHERE `ItemName` LIKE ‘$_SESSION[‘item’]’ LIMIT 1
“);

if ( $work && ( mysql_num_rows($work) > 0 ) )

$row = @mysql_fetch_assoc( $work );

echo ‘Php/sql form population values not submitted

Sql Databases Development » Search Results » ajax

Php/sql form population values not submitted

Share this post:

Related Posts

Leave a Comment