Jump to content


Why on earth does this not work?

  • Please log in to reply
1 reply to this topic

#1 -Felix-

  • Members
  • PipPip
  • Member
  • 11 posts

Posted 07 October 2005 - 02:18 PM

Hey its me again and stupid questions volume 3....

I dont get any errors, the following code just does not write anything to MySQL.

mysql_connect ("localhost", "login", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("database"); 

$Quality=$_SESSION['Quality'].'; '.$_SESSION['Quality2'];

mysql_query("INSERT INTO Tablename (Serialnumber,ID, Date, Details,Quality,Time,Status,Address) VALUES ($serialnumber,'1',$date,$Details,$Quality,$Time,'Waiting','Address')");


#2 effigy

  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 07 October 2005 - 06:41 PM

you should also use or die on your query statement. you are using a reserved keyword (date) as a column name. change it or surround them with backticks: ``.
Regexp | Unicode Article | Letter Database

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users