Jump to content

Stupid Query Problem


aussiefly

Recommended Posts

Hi everyone!

 

I am getting a mysql syntax error when I stick this query in my script.

$insert ="UPDATE `members` SET (email, password,  phone) VALUES ('$_POST[email]','.md5($_POST[password]).','.$_POST[phone]') WHERE `members`.`email` = $_SESSION[email]";

 

Its probably a bit of a sloppy query...i'm updating some user settings via a form.

 

any idea what i'm missing??? Ity's the first time I've tried to update multiple fields etc.

 

 

Link to comment
Share on other sites

Try this:

 

<?php
$insert ="UPDATE `members` SET (email, password,  phone) VALUES ('".$_POST[email]."','".md5($_POST[password])."','".$_POST[phone]."') WHERE `members`.`email` =".$_SESSION[email];
?>

 

There was a couple of syntax errors (quotes missing)

Link to comment
Share on other sites

yup i've tried all of those solutions and im still getting a syntax error when i click the submit.

 

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 '(email, password, phone) VALUES (randomemail@email.com,'c5dedfe8df822a7d3d9103' at line 1

 

any ideas why i suck at SQL :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.