Good afternoon,
I have a very little knowledge in php mysql. I want to make a periodical report of my company's strength of various departments. I have a html page like
<!DOCTYPE html> <html> <head></head> <body> <form action="" method="post">
Department : <select name="dept"><option>admin</option><option>finance</option><option>motor dept</option><option>logistics</option></select>
Designations:<select name="design"><option>clerks</option><option>executives</option><option>helpers</option><option>drivers</option></select>
No. of employees:<input type="text" name="persons" size=3"/> <input type="submit" name="submit"/></form>
//php code
<?php
$dept=$_POST["dept"];
$design=$_POST["design"];
$persons=$_POST["persons"];
$connect=mysql_connect("localhost", "root", "") or die ("error");
mysql_select_db("db", $connect);
$sql="INSERT INTO strength(dept, clerks, executives, helpers drivers) values ('$dept', '$design')";
?>
MY TABLE VIEW SHOULD COME LIKE:
CLERKS EXECUTIVES HELPERS DRIVERS
ADMIN
FINANCE
LOGISTICS
MOTOR DE
ERROR IS COMING LIKE: fields and values mismatch(it probably insert command mistake) Please help in this regard.
?> </body> </html>