Hey there,
I am trying to build a small survey for a homework assignment.
So, I have the following code:
$con = mysql_connect("localhost","user", "mypassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mydatabase", $con);
$slq = "INSERT INTO results VALUES('', '', '', '', '', '', '', '', '', '', '', '')";
mysql_query($sql, $con);
mysql_close($con);
What is even more weird is that I use this same sql statement through command line, as well as through phpMyAdmin, and it inserts a row in my results table in both cases, but it won't insert a row when I use it in a script.
Anyone knows what might I be doing wrong?
thank you.