SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/08/2018, 11:22 PM   #1
IdonTmiss
Big Clucker
 
Join Date: Dec 2016
Posts: 101
Reputation: 0
Default MySQL Insert Error

I have a problem with this bit of code, so if anybody can help me, please do so

PHP Code:
    new q[500];
    
mysql_format(MyHandleqsizeof q"INSERT INTO `table_3` (`type`, `shiet`, `fact`, `price`, `level`, `owner`, `enterx`, `entery`, `enterz`, `cash`, `isthere`) \
        VALUES (%d, %d, %d, %d, %d, %d, %f, %f, %f, %d, %d)"
,
        
BI[bizid][bType],
        
BI[bizid][bSheit],
        
BI[bizid][bFact],
        
BI[bizid][bPrice],
        
BI[bizid][bLevel],
        
BI[bizid][bOwner],
        
BI[bizid][bEnterX],
        
BI[bizid][bEnterY],
        
BI[bizid][bEnterZ],
        
BI[bizid][bCash],
        
BI[bizid][bIsThere]
    );
    
mysql_pquery(MyHandleq"OnBizCreate""businessid"bizid); // THIS LINE 
PHP Code:
forward OnBizCreate(businessid);
public 
OnBizCreate(businessid)
{
    
BI[businessid][bSqlID] = cache_insert_id();
    return 
1;

Code:
[plugins/mysql] mysql_pquery: callback error: parameter count does not match format specifier length

EDIT: bizid loops for the next address ( BIZ ADDRESS ) on the server
IdonTmiss is offline   Reply With Quote
Old 12/08/2018, 11:27 PM   #2
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 303
Reputation: 25
Default Re: MySQL Insert Error

You missed the '%s' in the values for owner
__________________
Banditul18 is offline   Reply With Quote
Old 12/08/2018, 11:29 PM   #3
IdonTmiss
Big Clucker
 
Join Date: Dec 2016
Posts: 101
Reputation: 0
Default Re: MySQL Insert Error

Quote:
Originally Posted by Banditul18 View Post
You missed the '%s' in the values for owner
It's not owner's name but if there is/isn't an owner like true/false
IdonTmiss is offline   Reply With Quote
Old 13/08/2018, 12:00 AM   #4
IdonTmiss
Big Clucker
 
Join Date: Dec 2016
Posts: 101
Reputation: 0
Default Re: MySQL Insert Error

fixed..
IdonTmiss is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
INSERT INTO mysql error OMonger Scripting Help 5 10/01/2016 06:40 PM
INSERT INTO mysql error [+rep] OMonger Scripting Help 3 10/01/2016 12:47 PM
MySQL - INSERT INTO error Rdx Scripting Help 4 19/02/2013 02:02 PM
Mysql INSERT INTO Error Larry123 Scripting Help 1 02/09/2012 03:18 PM
MySQL Insert ID Error CoaPsyFactor Scripting Help 2 07/06/2012 11:13 PM


All times are GMT. The time now is 10:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.