Jump to content

[SOLVED] query update problem


atticus

Recommended Posts

I am updating mysql server and having problems with the syntax, the data is posting form the form:

 

<?php
include("config.php");
  if(isset($_POST['submit']))

  {
  $id = mysql_escape_string($_POST['cust_id']);
      $lastname = mysql_escape_string($_POST['last_name']);
      $firstname = mysql_escape_string($_POST['first_name']);
	$username = mysql_escape_string($_POST['username']);
	$password = mysql_escape_string($_POST['password']);
	$phone = mysql_escape_string($_POST['phone']);
	echo $id, $lastname, $firstname, $username, $password, $phone;

$query = "UPDATE client SET last_name = '$lastname',
first_name = '$firstname',
username ='$username',
password = 'PASSWORD('$password')',
phone = '$phone' 
WHERE cust_id = '$id'"; 
mysql_query($query) or die('Error, insert query failed' . mysql_error());

 

error:

 

Error, insert query failedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'jjjjjjjjj')', phone = 'jjjjjjjjj' WHERE cust_id = '18'' at line 4

Link to comment
https://forums.phpfreaks.com/topic/82090-solved-query-update-problem/
Share on other sites

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.