Sign in with
Sign up | Sign in
Your question

PHP&MySQL Help

Tags:
  • CPUs
  • MySQL
  • Database
Last response: in CPUs
Share
January 19, 2005 5:27:27 PM

I don't see a programming forum so i'll just post it here.

General problem i am having is that PHP isn't writing to the database. It can read from the database but it cannot write to it. I am not getting any errors and i checked the MySQL log and nothing there. I can't find any php log file.

Here is the copy/paste of my code:

mysql_pconnect(&host,&user,&pw)
or die("Unable to connect to MySQL server - LINE: 71 =- " . mysql_error());

mysql_select_db("guestbook")
or die("Unable to select database - LINE: 72 =- " . mysql_error());

$query = "INSERT INTO guests (guest_id, guest_name, guest_email, guest_time, guest_message) VALUES(0000, '$name','$email',NULL,'$message')";

mysql_query($query) or die("Insert Failed!" . mysql_error());

// end code

I tried that exact query in the SQL prompt and it works using the same user name.

I am lost as to why it doesn't work. Any Suggestions?

Thanks!

<A HREF="http://www.anandtech.com/mysystemrig.html?id=9933" target="_new"> My Rig </A>

More about : php mysql

January 19, 2005 6:34:42 PM

Quote:
I don't see a programming forum so i'll just post it here.

So that whole Other Software forum is for what then?

<pre><b><font color=red>"Build a man a fire and he's warm for the rest of the evening.
Set a man on fire and he's warm for the rest of his life." - Steve Taylor</font color=red></b></pre><p>
!