I’m new to PHP and MySQL, working on an inventory system for my current job. Something simple, but working.
Right now you can login, view tables, etc, but I need to make it so that you can submit data to be added to the table.
Here is the a snippet of code from my tabledit.php
[php]
Now when you press sumbit, it’s supposed to use the saveproduct.php to submit the data. Here is the code the the saveproduct.php.
[php]<?php
$itemname=$_POST[‘itemname’];
$model=$_POST[‘model’];
$serialnumber=$_POST[‘serialnumber’];
$conidition=$_POST[‘condition’];
$notes=$_POST[‘notes’];
$fin = “Record Added”;
mysql_connect(“localhost”, “root”, “”) or die(mysql_error());
mysql_select_db(“CTD_Inventory”) or die(mysql_error());
mysql_query(“INSERT INTO inventory VALES (‘itemname’, ‘model’, ‘serialnumber’, ‘condition’, ‘notes’)”);
echo $fin;
header(“location: tableedit.php#page=addpro”);
?>[/php]
Now the weird thing is, is that it doesn’t submit the data. It clears the text boxes, I get no errors, but the MySQL database is not updated.
Any ideas? I appreciate the help!