hi,
please can someone help me, im new to php and have to create a stock control system
i been trying to add data to mysql database through php. i am having trouble with adding to the database when there is multiple fields. everything is fine when the database has one field, but if it has more than one, no data is added to it, not even the workinf original field. i dont know why...can someone help?
my form html - for when there is one field
<form name="form" method="post"
action="add_workin.php">
Name: <input type="text" name="name"><br>
<input type="Submit">
</form>
my php code for one field
<?php
mysql_pconnect('localhost');
mysql_select_db('test2');
mysql_query("insert into test values ('$name')");
?>
my html for 2 fields....(NOTHING GETS ADDED not even the working field)
<form name="form" method="post"
action="add_workin.php">
Name: <input type="text" name="name"><br>
Category: <input type="text" category="name"><br>
<input type="Submit">
</form>
my php code for two fields
<?php
mysql_pconnect('localhost');
mysql_select_db('test2');
mysql_query("insert into test values ('$name')");
mysql_query("insert into test values ('$category')");
?>
please help...thanks
please can someone help me, im new to php and have to create a stock control system
i been trying to add data to mysql database through php. i am having trouble with adding to the database when there is multiple fields. everything is fine when the database has one field, but if it has more than one, no data is added to it, not even the workinf original field. i dont know why...can someone help?
my form html - for when there is one field
<form name="form" method="post"
action="add_workin.php">
Name: <input type="text" name="name"><br>
<input type="Submit">
</form>
my php code for one field
<?php
mysql_pconnect('localhost');
mysql_select_db('test2');
mysql_query("insert into test values ('$name')");
?>
my html for 2 fields....(NOTHING GETS ADDED not even the working field)
<form name="form" method="post"
action="add_workin.php">
Name: <input type="text" name="name"><br>
Category: <input type="text" category="name"><br>
<input type="Submit">
</form>
my php code for two fields
<?php
mysql_pconnect('localhost');
mysql_select_db('test2');
mysql_query("insert into test values ('$name')");
mysql_query("insert into test values ('$category')");
?>
please help...thanks