MySQL problem
#1

pawn Код:
format(loe, sizeof(loe), "INSERT INTO kasutajaandmed (id, kasutaja, parool, skoor, raha, skin, level, rptest, tookoht, adminnilvl, vip, kma, liige, pealik, tapmisi, surmasi, vaigistatud, vangistatud, seisatud, vaigistatudk, vangistatudk, seisatudk, bannitud, logimisi, posx, posy, posz, posa, aktiveeritud, IP) VALUES(,'%s', SHA1('%s'), 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, '%s')", nimi, passwordstring, IP);
    mysql_query(loe);
I have an problem with this piece of code.
It will give me an error:
Код:
[20:22:00] CMySQLHandler::Query(INSERT INTO kasutajaandmed (id, kasutaja, parool, skoor, raha, skin, level, rptest, tookoht, adminnilvl, vip, kma, liige, pealik, tapmisi, surmasi, vaigistatud, vangistatud, seisatud, vaigistatudk, vangistatudk, seisatudk, bannitud, logimisi, posx, posy, posz, posa, aktiveeritud, IP) VALUES('','Vladimir_Koljanov', SHA1('213'), 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, '88.196.165.136')) - An error has occured. (Error ID: 1136, Column count doesn't match value count at row 1)
Does somebody know how to fix it?
Reply
#2

the first values doesn't need ,

change it from
Quote:

VALUES(,'%s'

to
Quote:

VALUES('%s'

Reply
#3

This isn't the problem. Fixed it already.
Reply
#4

id is autoincrement?
Reply
#5

it should be.
Reply
#6

Column contains 31 parameters
Quote:

id, kasutaja, parool, skoor, raha, skin, level, rptest, tookoht, adminnilvl, vip, kma, liige, pealik, tapmisi, surmasi, vaigistatud, vangistatud, seisatud, vaigistatudk, vangistatudk, seisatudk, bannitud, logimisi, posx, posy, posz, posa, aktiveeritud, IP

Else values contains 32 parameter
Quote:

'','%s', SHA1('%s'), 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, '%s'

find the missing column
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)