Page 1 of 1

Cannot perform insert tblmytbl query

Posted: Wed Sep 09, 2009 9:12 am
by php_new_guy_09
Hi all, Im completely new to MySQL and PHP.
I have set up a MySQL db for my website however, there seems to be a problem with my code.. How could I send this problem into a log file to see exactly what is wrong, as this is what I have been told to do.
Would it be possible if someone could coach me through step by step. Or is there something wrong with my code.

Code: Select all

$sql="INSERT INTO tblmytbl (field1, field2) VALUES('".$field1."','".$field2."');";
$result_sql = mysql_query($sql) or die("Cannot perform insert tblmytbl query");
Thanks alot

Re: Cannot perform insert tblmytbl query

Posted: Wed Sep 09, 2009 10:36 am
by php_new_guy_09
shinephp wrote:In order to save all php error messages into log file you need to setup these parameters in the php.ini file
error_reporting = E_ALL
display_errors = OFF
log_errors = ON
error_log = /homepages/xx/zz/htdocs/phplogs/php.log

setting
display_errors = ON
will show error messages on you browser window too.

Thanks alot, I'll give that a try later on this evening.