My database Mysql query doesn’t work.

My database Mysql query doesn’t work.,mysql,php database,mysql insert

 My database query doesn’t work.
Unexpected results or non-execution of a SQL (mySQL,msSQL,PDO,etc) query.
Cause: Varied
Solution: First and foremost, echo out your query to see if it is actually getting the variables you believe it should be. Also make sure you are echoing the error function of your given database type
If so, run the query on your database using your database tool of choice, or echo the error capturing functions of your chosen database connection type ([FPHP]mysql_error[/FPHP], [FPHP]mysqli_error[/FPHP] etc) such as:
$sql = "SELECT fail FRAM failtable WHERE id = $id";
echo $sql;
echo mysql_error();
mysql_query (string $ query [, resource $ link_identifier = NULL]): mixed
mysql_query () sends a single request (multiple requests are not supported) to the current database on the associated server with the specified link_identifier.

If you receive a Warning about a function expecting a parameter to be a resource, check the function previous to the one that generated the error, as it has generated errors.
If the results of said query are not what you were expecting, see the Databases forum (or MySQL subforum) for assistance as to your query.

if you want to improve the solution
comment to help the community
No comments
Post a Comment

Post a Comment