Forum Moderators: open

Message Too Old, No Replies

database not working please help

         

Flolondon

7:59 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



<?php

$host = "localhost";
$password = " ";
$database = "cars";

$connection = mysql_connect ("localhost", "root", "")
or die("Could not connect to localhost");

$db = mysql_select_db ($database, $connection)
or die (" could not connect to database");

$name = $_POST['name'];
$address = $_POST['address'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$comments = $_POST['comments'];
$delivery = $_POST['delivery'];
$breads = $_POST['breads'];

mysql_query($query) or die(mysql_error());
mysql_close($connection)

?>

coopster

8:24 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What is not working, Flolondon? I notice you have not yet developed your $query that you are trying to execute.

Flolondon

9:15 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2

it has a query but i did not list it... the above is the error response

coopster

9:48 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That is what you have wrong, according to the error. The syntax of your query statement is incorrect and causing the query to fail upon execution.