MySQL Forums
Forum List  »  PHP

Re: inserting a new row with php
Posted by: jkoerber
Date: May 01, 2005 11:40PM

Oli Par,

One important thing to remember when using MySQL with any language is to give yourself some level of error reporting. My guess, from your code above, is that you did not include a space between the "..(name,email)" and "VALUES ('$name','$email')" strings. This will generally cause a parsing error in MySQL. Consider changing your code to add the following for all queries. This way, if you have a bug in your code, PHP can let you know what the problem is:

if (!$result = mysql_query($query, $link_id)) {
die("Could not execute this query - ERRNO:".mysql_errno()." -- ERROR:".mysql_error()." -- QUERY:".$query);
}

This way you will get a nice indication of what the problem was so you can more easily trach it down.

Jon

Options: ReplyQuote


Subject
Written By
Posted
May 01, 2005 06:49PM
Re: inserting a new row with php
May 01, 2005 11:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.