I am trying to add a record to a table.
Using previously- functional code lifted from another project, the script dies at the mysql_query() line.
I have confirmed that the information to be inserted is being passed properly from the form page, that the variables and field names match and are in sequence and the coding is correct.
The problem I am having in debugging is that I cannot get an explanatory error message to generate.
Here is a snippet (MySQL version 5.5.43-37.2-log on a Godaddy server)
$query = "INSERT INTO linkdb (keywords.category,title,link,icon,id_no) values ($inkeywords,$incategory,$intitle,$inlink,$inicon,$inid_no)"; mysql_query($query) or die("error :".mysqli_error($connection));
"$connection" being the correct mysql_connect data.
The error string generated by the server is:
"warning: mysqli-error() expects parameter 1 to be mysqli, resource given in ......"
The above line of code was adapted from page 350 of "PHP & MySQL Web Development for Dummies" by Janet Valade, whom I trust more than W3Schools...
I suspect there may be a problem with the compatibility of the construction of the table and fields, but I am reluctant to change anything blindly as the table is currently in use on a website.
How do I get the actual error information to appear?
Your Humble servant,
Ack