I am trying to work with databases on PHP, however I am getting an error when I try to make a table of data. The table seems to be created correctly (I think) but when I want to print the confirmation of the table is created, it throws me an error. This is the code:
if (mysql_query($connection,$sql)) //error
{
echo "1 record added";
}
else
{
die('Error: ' . mysql_error($con)); //error
}
They both give me the error mysql_query() expects parameter 1 to be string and mysql_error() expects parameter 1 to be resource
Where
$sql - the info being put in the table