Cannot perform insert tblmytbl query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
php_new_guy_09
Forum Newbie
Posts: 12
Joined: Fri Sep 04, 2009 3:21 pm

Cannot perform insert tblmytbl query

Post 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
php_new_guy_09
Forum Newbie
Posts: 12
Joined: Fri Sep 04, 2009 3:21 pm

Re: Cannot perform insert tblmytbl query

Post 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.
Post Reply