I need to be able to check if the mysql_query($query) has any errors in it?
How do i display this?
Im trying to do an insert and its not inserting into mysql for some reason? was just working fine a couple minutes ago, now its not working at all?
How to check errors of a mysql_query?
Moderator: General Moderators
-
mischievous
- Forum Commoner
- Posts: 71
- Joined: Sun Apr 19, 2009 8:59 pm
Re: How to check errors of a mysql_query?
put "or die(mysql_error());" after the query...
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: How to check errors of a mysql_query?
Yes, mysql_error() is the function you are interested in.
Re: How to check errors of a mysql_query?
Not always failed query means end of script execution, maybe just rolling back the transaction?jackpf wrote:put "or die(mysql_error());" after the query...
Re: How to check errors of a mysql_query?
Yeah I know.
But...he said he wanted to check why a query was failing. That's the quickest way imo.
But...he said he wanted to check why a query was failing. That's the quickest way imo.
Re: How to check errors of a mysql_query?
+1jackpf wrote:Yeah I know.
But...he said he wanted to check why a query was failing. That's the quickest way imo.