WBStats

Started by Finch, Apr 03, 2015, 04:48 AM

Previous topic - Next topic

Finch

Hey guyz i add wbstats in my server but  they give me error on function register  on line these of wbstats
QuerySQL( sDB, "INSERT INTO BodyStats (Name, BodyParts) VALUES (%s'%i')", player.Name, "0 0 0 0 0 0 0)" );
QuerySQL( sDB, format( "REPLACE INTO WeaponStats (Name, Weps) VALUES ('%i')", player.Name, "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" ) );     



And  error is sorry but i cant post screen shot due to reason

this is error
wrong number of parametes
Beztone is a scripter but he is too stupid

Thijn

You forgot the format function in the first QuerySQL.

.

#2
Quote from: Thijn on Apr 03, 2015, 05:48 AMYou forgot the format function in the first QuerySQL.

Not only that but also the "," is missing before and between those zeroes. And the inner double quotes aren't escaped.

Off: Would it kill you if you would use [-code] [-/code] tags? Seriously. Wtf is wrong with you?
.

Thijn

@S.L.C. He's actually saving those zeroes with spaces in between, which in that case should be saved as a string not an integer.

Are you sure you want to save it that way Finch?

.

#4
@Thijn. Actually, hold on. His usage of the format function confused me. "(%s'%i'" there should be a "," between like "(%s, %i'". But why not use those zeroes directly in the query string? What's the point of formatting hard coded values?

And by the way, putting an %i when you specify a string of numbers, don't necessarily make them  a number.
.

MacTavish

Actually the fault i've seen that format( is missing in BodyStats query maybe it is the problem

try this one
QuerySQL( sDB, format("INSERT INTO BodyStats (Name, BodyParts) VALUES (%s,'%i')", player.Name, "0 0 0 0 0 0 0") );
 

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

.

#6







MORAL OF THE STORY: RTFM
.