FootFungas wrote:
php wrote:
<?php
$con = mysql_connect("localhost","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
mysql_query("INSERT INTO userdata (Username, Password, Location)
VALUES ('guest', 'password', 'US')");
mysql_close($con);
?>
I don't get any errors, it just doesnt insert the values.
try this
$qr=mysql_query("INSERT INTO userdata (Username, Password, Location) VALUES ('guest', 'password', 'US')") or die(mysql_error());
if you don't put that die() clause mysql will fail silently. See if it gives you an error, should work tho.
one more thing, i find that insert syntax very tedious, try using:
$qr=mysql_query("INSERT INTO userdata SET Username='guest', Password='password', Location='US'") or die(mysql_error());