hi being new i have managed to get this to work for two feilds from a form but am unsure where I am going wrong here any help would be good


<?php
                $pilot_id= $_POST['pilot_id'];
	$message = $_POST['message'];
	$email = $_POST["email"];
	$password = $_POST["password"];
	$hours = $_POST["hours"];
	$transhours = $_POST["transhours"];
	$password = $_POST["password"];
	$lastdate = $_POST["lastdate"];
	$joindate = $_POST["joindate"];
	$nextflight = $_POST["nextflight"];
	$atc = $_POST["atc"];
	$name = $_POST["name"];
	$hub = $_POST["hub"];
	$flights = $_POST["flights"];
	$miles = $_POST["miles"];
	$fuel =   $_POST["fuel"];
	$award1 = $_POST["award1"];
	$award2 = $_POST["award2"];
	$award3 = $_POST["award3"];
	$award4 = $_POST["award4"];
	$award5 = $_POST["award5"];
	$award6 = $_POST["award6"];
	$award7 = $_POST["award7"];
	$award8 = $_POST["award8"];

$link = mysql_connect("localhost", "blah", "blah");
mysql_select_db("blah", $link);
$query = "UPDATE members  SET email = '$email', password = '$password', message = '$message', hours = '$hours', transhours = '$transhours', lastdate ='$date', joindate = '$joindate',atc ='$atc', name = '$name', hub='$hub', flights= '$flights', miles= '$miles', fuel = 'fuel',award1 = '$award1', award2 = '$award2', award3 = '$award3', award4 = '$award4',
							  award5 = '$award5', award6 = '$award6', award7 = '$award7', award8 = '$award8' WHERE pilot_id = '$pilot_id'";
$result = mysql_query($query, $link);
mysql_close($link)

?>

I just can not see where I am going wrong here๐Ÿ™

thanks
Lee

    $query = "UPDATE members  SET email = '$email', password = '$password', message = '$message', hours = '$hours', transhours = '$transhours', lastdate ='$date', joindate = '$joindate',atc ='$atc', name = '$name', hub='$hub', flights= '$flights', miles= '$miles', fuel = 'fuel',award1 = '$award1', award2 = '$award2', award3 = '$award3', award4 = '$award4',
                                      award5 = '$award5', award6 = '$award6', award7 = '$award7', award8 = '$award8' WHERE pilot_id = '$pilot_id'"; 
    

    I think this might be your problem, If your database field is numeric then you do not put single quotes around the value. I am guessing a field like miles would be a numeric field so it should say miles=$miles without the ' '.

      Plus, you didn't give us any output, including the error MySQL is returning.

      Hard to know what the problem is when you don't give us all the errors.

        yes sorry about the lack of information. I have included a link to the form ,where you enter your data I have also used the echo command to show the results on the script page just to check the information is being passed from the form. I also added the phpmyadmin table to help show what fields are there and the structure of thos e fields.

        hope this helps more .

        link to form and script

        regards

        Lee

          Write a Reply...