Mike Tew
asked on
php form post to database
I'm updating a database from form post via php. However, I'm getting a error when 0 (aka. zero) is the value, and its being dropped from the value being posted to the database. Is this a result of my table formatting in mysql?
use the isset() instead
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can we see the code? Is the code for getting the value like this:
$fieldOne = addslashes($_POST['fieldNa me']);
and the mysql query:
mysql_query("UPDATE table_name SET some_column = '$fieldOne' WHERE id = 'id_number'");
I hope this will solve the problem
$fieldOne = addslashes($_POST['fieldNa
and the mysql query:
mysql_query("UPDATE table_name SET some_column = '$fieldOne' WHERE id = 'id_number'");
I hope this will solve the problem
ASKER
I'm still learning mysql, the query is correct. Fixed the issue though, the issue was that field was int not varchar. Now that I have switched, not problems with updating. Thanks for the hint logudotcom.
ASKER
Converted column from int to varchar and it worked