PHP Connection to MySQL?

Brodie Pestell

New member
I have this code to connect to my database the connect.php works fine but the database will not update please help. Code:

<?php
include('connect.php');
$name1 = $_POST['name'];
$name = strtoupper($name1);
$address = $_POST['address'];
$phone = $_POST['number'];
$mot = $_POST['mot'];
$reg1 = $_POST['reg'];
$reg = strtoupper($reg1);
$vin = $_POST['vin'];
$engine = $_POST['engine'];
$car = $_POST['car'];
$misc = $_POST['comment'];
$job1 = $_POST['desc'];
$job2 = $_POST['mileage'];
$job3 = $_POST['date'];
$invoice = $_POST['invoice'];

$query = mysql_query("UPDATE cards SET address='$address', phone='$phone', date='$mot', reg='$reg', vin='$vin', engine='$engine', make='$car', misc='$misc', invoice='$invoice', desc='$job1' date1='$job3', mileage1='$job2' WHERE name='$name'")
or die ('Error - Could not register user.');

?>


Output:

Error - Could not register user.
 
Back
Top