Jump to content


Photo

Why on earth does this not work?


  • Please log in to reply
1 reply to this topic

#1 -Felix-

-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"); 


$serialnumber=$_SESSION['Serialnumber'];
$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')");


mysql_close();


#2 effigy

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
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users