Jump to content

Help with my error logging system


thefollower

Recommended Posts

I need help with my error logging script.. i keep getting the query stateing "Error" in my database... suggesting theres something wrong with the first two but i dont see any syntax issues so what else could it be ?

 

Here is what i got:

 

<?php
$INSERT = mysql_query("INSERT INTO gamelogs (Log,LogTime)
			VALUES('connect established 4a','$Date')")
Or die(mysql_error());
// inserts no problem

$INSERT = mysql_query("INSERT INTO eventslogs (`Log`,`LogTime`,UserID)
		VALUES ('Your log has been inserted!','$Date','$custom')")
Or die( 

$bleh = mysql_query( "INSERT INTO gamelogs ( `Log`,`LogTime` ) VALUES ('".mysql_error()."','$Date')" )

Or die( 

$bleh1 = mysql_query( "INSERT INTO `gamelogs` ( `Log`,`LogTime` ) VALUES ('error','$Date')" ))

);
?>

 

I always get $bleh1 loggin error ... and no event is inserted nor is the $bleh query which should log the mysql_error so i know what actually went wrong is being inserted so its kinda impossible to know what is going wrong... I get no errors on my server error logs just to add.

 

Hope you can help.

Link to comment
https://forums.phpfreaks.com/topic/128393-help-with-my-error-logging-system/
Share on other sites

Try and remove the `` around gamelogs in $bleh1.

 

Thanks for your reply,

 

heres what i now have:

 

<?php
$INSERT = mysql_query("INSERT INTO gamelogs (Log,LogTime)
			VALUES('connect established 4a','$Date')")
Or die(mysql_error());

$INSERT = mysql_query("INSERT INTO eventslogs (Log,LogTime,UserID)
		VALUES ('Your log has been inserted','$Date','$custom')")
	Or die( $bleh = mysql_query( "INSERT INTO gamelogs ( Log,LogTime ) VALUES ('".mysql_error()."','$Date')" )
	Or die( $bleh1 = mysql_query( "INSERT INTO gamelogs ( Log,LogTime ) VALUES ('error','$Date')" )));
?>

 

I still get "error" logged into my database in my gamelogs instead of $bleh inserting the error...and no syntax error on my server error logs.. hope you can help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.