Jump to content

Archived

This topic is now archived and is closed to further replies.

-Felix-

Why on earth does this not work?

Recommended Posts

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

Share this post


Link to post
Share on other sites

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: ``.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.