accomodating new - Error updating database php mysql
If you change the connection parameters of the second connection to 127.0.0.1, a new connection is returned. Most often, the output message from My SQL doesn't let you see enough of the query in the error message to let you see where your query went bad- it a missing quote, comma, or ( or ) could have occured well before the error was detected.In addition to the parameters new_link the mysql_connect() function to be forced. I do -not- recomend using this procedure, however, for queries which execute on your site that are not user-specific as it has the potential to leak sensative data.I run my queries by hand in a mysql IDE or mysql command line editor to see what the issues are.
You have an error in your SQL syntax; check the manual that corresponds to your My SQL server version for the right syntax to use near '' at line 1 The query seems not to be producing a result. i have commented out some lines which i thought where a problem but they are fine. though I'd be looking at something a little more robust in production code.
I am passing an id to a function via a url but the variable seems to die although it seems to be in scope. Still, that should be enough to identify the immediate problem.
See also My SQL: choosing an API guide and related FAQ for more information. Be aware that if you are using multiple My SQL connections you MUST support the link identifier to the mysql_error() function. Just spent a good 30 minutes trying to figure out why i didn't see my SQL errors.'s function, I created the following. It handles both original query, as well as the error log.
Alternatives to this function include: If you want to display errors like "Access denied...", when mysql_error() returns "" and mysql_errno() returns 0, use $php_errormsg. Included Larry Ullman's escape_data() as well since I use it in q().
You get the error description from the last mysqli-function, not from the last mysql-error. $mysqli- Please note that the string returned may contain data initially provided by the user, possibly making your code vulnerable to XSS.