Hello,
I have a script which is supposed to add a number (inputed into a HTML form, and passed to a PHP script) to a MySQL database. The field in the database says this:
PHP Code:
Name: number
Type: INT
Legenth: 3
Attributes: Blank
Null: not null
Default: 5
Extra: Blank
The PHP script looks like this:
PHP Code:
<?php
$housename = gryffindor;
$number=$_POST['number'];//get the number from POST
settype($number, "integer");//make sure it's a number not a string ..
$conn = mysql_connect ("localhost", "PUTDATABASEUSERNAMEHERE", "PUTDATABASEPASSWORDHERE");
mysql_select_db ("PUTDATABASENAMEHERE",$conn);
$sql = "INSERT INTO $housename values ('', number=number+$number)";
if (mysql_query($sql, $conn)) {
echo "record added!";
} else {
echo "something went wrong";
}
?>
On my test machine, all it says is "Something Went Wrong". Why is that?
Also, on my main server, I get a MySQL "Seeking" error. I've never heard of that. What does it mean?