Hi!
When I execute the following script only 0 value is update in the mysql database.
can anybody guide me please.
?php
//Our PHP/MYSQL page.
//This script takes the data from the form
//fields and adds them to specified parts
//parts of the database
//MySQL Variables. Edit where necessary
$username="root";
$password="terisrc";
$database="mydb";
//Connecting to MYSQL
mysql_connect(localhost,$username,$password);
//Select the database we want to use
@mysql_select_db($database) or die("Unable to select database");
('$empcode','$basicpay','$name')")or die("Insert Error: ".mysql_error());
$result=mysql_query("INSERT INTO staffsalary VALUES ('$empcode','$basicpay','$name')")or die("Insert Error: ".mysql_error());
//$result = mysql_query($sql);
//Code to check if statement executed properly and display message
if ($result) {
echo("record inserted");
} else {
echo("An error has occured");
}
//Close connection with MySQL
MySQL_close()
?>