Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Problema UPDATE in baza de date


Question

Posted

Salut, ma numesc Serban, am 13 ani, am deschis acest topic pentru ca am nevoie de putin ajutor, stiu, sunt cersetor dar nu am o vaga idee de ce UPDATE-ul din Baza de date seteaza la toti jucatorii(Nu, n-am folosit un loop de for(i max players) ca sa fac acest lucru), pur si simplu seteaza la toti jucatorii valoarea care le-am acordat-o unui singur jucator, cum am eu scris "id".

 

Sintaxa: 

"mysql_format(handle, query, sizeof(query), "UPDATE `conturi` SET `blabla`='%d'", PlayerInfo[playerid][blabla]);
 mysql_query(handle, query);"

 

Va rog daca puteti sa ma lamuriti de ce, va multumesc pentru ajutorul acordat!

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

Iti lipseste clauuza WHERE din query

UPDATE conturi SET blabla = %d WHERE name = '%s'

Sau ma rog in functie de ce conditie vrei sa caute playeru si sa il actualizeze

Edited by Banditul
  • 0
Posted

"mysql_format(handle, query, sizeof(query), "UPDATE `conturi` SET `blabla`='%d'  WHERE `ID`='%d'", PlayerInfo[playerid][blabla], PlayerInfo[playerid][pSQLID]);
 mysql_query(handle, query);"

 

Sper ca am fost de ajutor.

  • 0
Posted

Nu-mi salveaza, am mai incercat odata acum cateva zile, am incercat azi iara si nu imi face update in baza, ce sa mai fac?

  • 0
Posted

mysql_format(handle, query, sizeof(query), "UPDATE `conturi` SET `Admin` = '%d' WHERE 'ID' = '%d'", PlayerInfo[id][pAdmin], PlayerInfo[id][pID]);
mysql_tquery(handle, query); 

 

Asta e sintaxa care am folosit-o, daca am scris ceva gresit, sa ma corectati, multumesc.

  • 0
Posted
mysql_format(handle, query, sizeof(query), "UPDATE `conturi` SET `Admin` = '%d' WHERE `ID` = '%d'", PlayerInfo[id][pAdmin], PlayerInfo[id][pID]);

La ID ai pus apostrof in loc de tilda, cel mai probabil aparea si in mysql log daca te uitai ca eroare

  • Upvote 1
  • 0
Posted

MERSI, Banditule, sa te ajuta dumnezeu cu toata miruirea ta, best scripter coae mersi sa te ajute miezau nimeni nu a stiut si numa tu ai putut sa ma ajuti in totalitate, multumesc, probabil asta este primul si ultimul ajutor care o sa am nevoie deoarece am samp.wiki si ce mai e pe forumuri, multumesc, respect, da-mi add pe discord Witz#0544!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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. For more details you can also review our Terms of Use and Privacy Policy.