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
https://forums.phpfreaks.com/topic/92069-stupid-query-problem/
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
https://forums.phpfreaks.com/topic/92069-stupid-query-problem/#findComment-471480
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 ([email protected],'c5dedfe8df822a7d3d9103' at line 1

 

any ideas why i suck at SQL :)

Link to comment
https://forums.phpfreaks.com/topic/92069-stupid-query-problem/#findComment-471483
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.