Jump to content

can somebody help me spot the syntax error in the code below?


solvinia

Recommended Posts

<?php

if (isset($_POST['submit']) && $_POST['submit'] == "Update") {

  $query_update = "UPDATE agent SET " .

                  "firstName = '" . $_POST['firstName'] . "', " .

                  "surname = '" . $_POST['surname'] . "', " .

  "email = '" . $_POST['email'] . "', " .

  "mobileNo = '" . $_POST['mobileNo'] . "', " .

  "otherNo = '" . $_POST['otherNo'] . "', " .

                  "Dob = '" . $_POST['Dob'] . "', " .

                  "WHERE username = '" . $_SESSION['user_logged'] ' "'.

          "AND password = '" .$_SESSION['user_password'] ;";"

 

  $result_update = mysql_query($query_update)

    or die(mysql_error());

 

  $query = "SELECT * FROM agent " .

          "WHERE username = '" . $_SESSION['user_logged'] . "' " .

          "AND password = (PASSWORD('" .

          $_SESSION['user_password'] . "'))";

  $result = mysql_query($query)

    or die(mysql_error());

 

  $row = mysql_fetch_array($result);

?>

apparently the error is anywhere after the where clause 

 

 

[$query_update = "UPDATE agent SET " .

                  "firstName = '" . $_POST['firstName'] . "', " .

                  "surname = '" . $_POST['surname'] . "', " .

  "email = '" . $_POST['email'] . "', " .

  "mobileNo = '" . $_POST['mobileNo'] . "', " .

  "otherNo = '" . $_POST['otherNo'] . "', " .

                  "Dob = '" . $_POST['Dob'] . "', " .

                  "WHERE username = '" . $_SESSION['user_logged'] ' "'.

          "AND password = '" .$_SESSION['user_password'] ;";"]

 

 

Archived

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

×
×
  • Create New...

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.