Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
Script: /home/.../ubb7/scripts/changebasic.inc.php
Line#: 591
SQL 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 'where USER_ID = 3' at line 3
SQL Error #: 1064
Query: update ubbt_USERS set where USER_ID = 3

Last edited by Rick; 08/11/2006 4:45 PM.

my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Aug 2006
Posts: 111
member
member
Joined: Aug 2006
Posts: 111
The SQL error is because it doesn't know what to "set."

Code
 update ubbt_USERS set where USER_ID = 3


Should be something like:

Code
 update ubbt_USERS set SOMETHING where USER_ID = 3

Joined: Aug 2006
Posts: 111
member
member
Joined: Aug 2006
Posts: 111
Maybe here?

Code
 $query_string = preg_replace("/,$/","",$query_string);
		array_push($query_vars,$user['USER_ID']);
		$query = "
			update	{$config['TABLE_PREFIX']}USERS
			set			$query_string
			where		USER_ID = ?
		";


Hmmm, actually, it looks like there is "$query_string" here, so maybe not here.

Fred

Last edited by Fred; 08/10/2006 2:08 PM.
Joined: Jul 2006
Posts: 117
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 117
Likes: 4
The problem is in this code segment:

Code
	if ($changedisplay || $changeemail || $changepassword) {
		$query_vars = array();
		$query_string = "";
		if ($changedisplay) {
			$query_string = "USER_DISPLAY_NAME = ? ,";
			array_push($query_vars,$displayname);
		} // end if
		if ($changepassword) {
			$query_string .= "USER_PASSWORD = ? ,";
			array_push($query_vars,$ChosenPassword);
		}
		$query_string = preg_replace("/,$/","",$query_string);

I didn't tried it, but the fix should be something like:

Code
	if ($changedisplay || $changeemail || $changepassword) {
		$query_vars = array();
		$query_string = "";
		if ($changedisplay) {
			$query_string = "USER_DISPLAY_NAME = ? ,";
			array_push($query_vars,$displayname);
		} // end if
		if ($changeemail)
		{
			$query_string .= "USER_REAL_EMAIL = ? ,";
			array_push($query_vars,$Email);		
		}
		if ($changepassword) {
			$query_string .= "USER_PASSWORD = ? ,";
			array_push($query_vars,$ChosenPassword);
		}
		$query_string = preg_replace("/,$/","",$query_string);

Joined: Aug 2006
Posts: 111
member
member
Joined: Aug 2006
Posts: 111
Anyone notice the "$query_string .=" and "$query_string ="

Notice the extra . in the first one.

Should that be like that as well?

Fred

Joined: Jul 2006
Posts: 117
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 117
Likes: 4
Yes, ".=" will append data to an existing variable (in this case $query_string)


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Selling a Forum?
by ECNet - 10/10/2026 10:54 AM
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Who's Online Now
0 members (), 298 guests, and 124 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)