Jump to content

mysql syntax error =(


spode

Recommended Posts

Meh...\ heres the error: 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 '' at line 1.

I get these all the friggin' time.  ???

<?php
		$uname = $_POST['uname'];
		$npass = $_POST['npass'];
		$vpass = $_POST['vpass'];
		if ($vpass == $npass) {
			$insertinfo = "UPDATE tbl_users SET username='$uname', password='$npass' WHERE uid=$uid";
			if (mysql_query($insertinfo)) {
				echo "Information successfully updated!";
				} else {
				echo "Information failed to update because " . mysql_error();
				}
			} else {
				echo "Your passwords did not match. Please <a href=\"crud.php?uid={$list['uid']}&action=edit\">try again</a>";
				}
?>

 

that's not the whole code but it's enough to figure it out

Link to comment
https://forums.phpfreaks.com/topic/53547-mysql-syntax-error/
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.