34534534534555
IS-IT--Management
Hi
Could someone please shed some light as to why this INSERT statement will not work.
The column names are only a selection (unordered) of those in this table. I also have a column name : auctionid which is the primary key and is set to auto increment, does it or do i need to refer to it in the INSERT?
Help is very much appreciated.
| Feedback is always appreciated as this will help to further our knowledge as well |
Could someone please shed some light as to why this INSERT statement will not work.
Code:
<?php
session_start();
$isbn = $HTTP_POST_VARS['booktitle'];
$startprice = $HTTP_POST_VARS['startprice'];
$buyitnowprice = $HTTP_POST_VARS['buyitnowprice'];
$bookcondition = $HTTP_POST_VARS['bookcondition'];
$additionalcomments = $HTTP_POST_VARS['additionalcomments'];
$username = $_SESSION['name'];
print ($_SESSION['name']);
print ("<br>$isbn<br>");
print ("$startprice<br>");
print ("$buyitnowprice<br>");
print ("$bookcondition<br>");
print ("$additionalcomments<br>");
mysql_connect("localhost", "name", "pass") or die ("Could not connect to MySQL Server");
$db = "db";
mysql_select_db("$db") or die("Could not open $db: ".mysql_error() );
$sql = "INSERT INTO auction ('sellerusername', 'startprice', 'isbn', 'visible', 'status', 'bookcondition', 'buyitnow')
VALUES ('$username', '$startprice', '$isbn', 'true', 'open', '$bookcondition', '$buyitnowprice')";
?>
The column names are only a selection (unordered) of those in this table. I also have a column name : auctionid which is the primary key and is set to auto increment, does it or do i need to refer to it in the INSERT?
Help is very much appreciated.
| Feedback is always appreciated as this will help to further our knowledge as well |