Jump to content
php.lv forumi

You have an error in your SQL syntax


-=HELLBENDER=-

Recommended Posts

Sveiki..

Veidoju priekš spēļu servera UCP, kur varētu rediģēt status, bet pie query metas errors un neizdodas rediģēt lietotāju kontus..

Errors:

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 ' phonenr = 0, banned = 0, ' at line 15

Kods:

			  $sql->query("UPDATE ".TABLE_PREFIX."users SET
		                                                   username    = '".$uname."',
														   sex  	   = ".$usex.",
														   level = ".$uplayer.",
														   adminlevel  = ".$uadmin.",
														   cash        = ".$upocket.",
														   account     = ".$ubank.",
														   famnum      = ".$uleader.",
														   team        = ".$ufaction.",
														   rank        = ".$urank.",
														   job         = ".$ujob.",
														   skin        = ".$uskin.",
														   jailtime    = ".$ujailtime.",
														   npcrep 	   = ".$unpcrep.",
														   oocp  	   = ".$uoocp.",
														   phonenr     = ".$uphonenr.",
														   banned      = ".$ubanned.",
														   materials   = ".$umaterials.",
														   drugs       = ".$udrugs.",
														   age         = ".$uage.",
														   lighter     = ".$ulighter.",
														   cigs        = ".$ucigs."

														   WHERE id=".intval($core->get['uid'])." 

		  ");

 

Izsecināju ka, ja noņem kādus ~8 nost, tad nav errors. Par garu query? Centos sadalīt, nesanāca.

Link to comment
Share on other sites

uztaisi pirms $sql->query() vienkārši echo tam visam un parādi, ko izvada:

echo("UPDATE ".TABLE_PREFIX."users SET

username = '".$uname."',

sex = ".$usex.",

level = ".$uplayer.",

adminlevel = ".$uadmin.",

cash = ".$upocket.",

account = ".$ubank.",

famnum = ".$uleader.",

team = ".$ufaction.",

rank = ".$urank.",

job = ".$ujob.",

skin = ".$uskin.",

jailtime = ".$ujailtime.",

npcrep = ".$unpcrep.",

oocp = ".$uoocp.",

phonenr = ".$uphonenr.",

banned = ".$ubanned.",

materials = ".$umaterials.",

drugs = ".$udrugs.",

age = ".$uage.",

lighter = ".$ulighter.",

cigs = ".$ucigs."

 

WHERE id=".intval($core->get['uid'])."

 

");

Link to comment
Share on other sites

Izsecināju ka, ja noņem kādus ~8 nost, tad nav errors. Par garu query? Centos sadalīt, nesanāca.

Kverijs nav par garu, visticamak ka megjini warchar tipa lauka ievadit datus bez pedinjam

kautkur sheit ..

npcrep          = ".$unpcrep.",
oocp            = ".$uoocp.",
phonenr     = ".$uphonenr.",

nezinot tabulas lauku strukturu neko nevar pateikt ...

P.S. un parbaudi vai lauku nosaukumi ir pareizi uzrakstiti (vispar eksistee)

Link to comment
Share on other sites

UPDATE users SET username = 'Toksiks_Toljstiks', sex = 1, level = 0, adminlevel = 0, cash = 295, account = 137, famnum = 0, team = 3, rank = 0, job = 0, skin = 26, jailtime = 0, npcrep = 0, oocp = , phonenr = 0, banned = 0, materials = 0, drugs = 0, age = 18, lighter = 0, cigs = 0 WHERE id=3

 

 

DB it kā viss kārtībā (vismaz man tā liekas).. Bilde: http://www.bildites.lv/images/zfz0gqkxkv0y0sl4b4lx.png

Link to comment
Share on other sites

un shis tavuprat ir normali ?

oocp = , 

kaa minimums oocp ='',

visticamak ka mainigais $uoocp nav nemaz definets

attiecigi shi ir taa reize, kad paradas PHP minuss ka ljauj izmantot nedefinetus mainiigos

Ja buutu ieprieksh vinju definejis (pieskjiris kadu vertibu), tad kljuda neparadiitos ...

edit: iesaku koda izstrades laika ieslegt arii error Notes, kas paradiitu ka tiek izmantots nedefinets minigais ...

Edited by Grey_Wolf
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...