SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 06/06/2018, 03:21 PM   #91
Akeem
Big Clucker
 
Join Date: Aug 2017
Location: Guyana
Posts: 87
Reputation: 0
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Hey max, rep+ for this i love it but i was wonder if you can go to the other level and make a tutorial about using some of the functions that aren't the basic. The samp community would greatly appreciate.
Akeem is offline   Reply With Quote
Old 06/06/2018, 04:25 PM   #92
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 327
Reputation: 37
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by Akeem View Post
Hey max, rep+ for this i love it but i was wonder if you can go to the other level and make a tutorial about using some of the functions that aren't the basic. The samp community would greatly appreciate.
Thank you. Look here for tutorial. https://github.com/ThreeKingz/easy-m...ster/README.md
Max_Andolini is offline   Reply With Quote
Old 14/06/2018, 07:30 PM   #93
altunatively
Little Clucker
 
Join Date: May 2018
Posts: 2
Reputation: 0
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Wow, gonna port my account saving to mysql, +REP for you!
altunatively is offline   Reply With Quote
Old 23/06/2018, 01:46 PM   #94
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 327
Reputation: 37
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Update published.

-Added more logtype.
-Small changes.
-Added every query error print.

https://github.com/ThreeKingz/easy-m...easy-mysql.inc
Max_Andolini is offline   Reply With Quote
Old 23/06/2018, 01:49 PM   #95
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 327
Reputation: 37
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by JR_Junior View Post
The following code is not working:
PHP Code:
    new string[128], names[24],money;
    new 
handle SQL::OpenEx(SQL::MREAD"Accounts""", -110, -1"Money");
    
SQL::ReadRetrievedRows(handlei)
    {
        
SQL::ReadString(handle"AccountName"names24i);
        
SQL::ReadInt(handle"Money"moneyi);
        
format(stringsizeof(string), "Name %s | Money: %d"names,money);
        
SendClientMessage(playerid, -1string);
    }
    
SQL::Close(handle); 
Accounts in DB: 7

In the Mysql log:
PHP Code:
[13:42:36] [DEBUGmysql_query(1"SELECT * FROM `Accounts` WHERE `Money`='' ORDER BY `Money` DESC LIMIT 10 "1)
[
13:42:36] [DEBUGCHandle::Execute(this=0x4f8c170type=3query=0x6705fd0)
[
13:42:36] [DEBUGCConnection::Execute(query=0x6705fd0this=0x674f80connection=0x4fa5968)
[
13:42:36] [DEBUGCQuery::Execute(this=0x6705fd0connection=0x4fa5968)
[
13:42:36] [INFOquery "SELECT * FROM `Accounts` WHERE `Money`='' ORDER BY `Money` DESC LIMIT 10 " successfully executed within 0.616 milliseconds
[13:42:36] [DEBUGCResultSet::Create(connection=0x4fa5968query_str='SELECT * FROM `Accounts` WHERE `Money`='' ORDER BY `Money` DESC LIMIT 10 ')
[
13:42:36] [DEBUGcreated new resultset '0x6710788'
[13:42:36] [DEBUGfetched MySQL result '0x66f8990'
[13:42:36] [DEBUGallocated 0 bytes for PAWN result
[13:42:36] [DEBUGCHandle::Execute - return valuetrue
[13:42:36] [DEBUGmysql_query: return value'1'
[13:42:36] [DEBUGcache_is_valid(1)
[
13:42:36] [DEBUGcache_is_valid: return value'true'
[13:42:36] [DEBUGcache_get_row_count(0x05FFF1E0)
[
13:42:36] [DEBUGcache_get_row_count: return value'1'
[13:42:36] [DEBUGcache_get_row_count(0x05FFF1D8)
[
13:42:36] [DEBUGcache_get_row_count: return value'1'
[13:42:36] [DEBUGcache_is_valid(1)
[
13:42:36] [DEBUGcache_is_valid: return value'true'
[13:42:36] [DEBUGcache_delete(1)
[
13:42:36] [DEBUGcache_delete: return value'1' 
Tried too: new handle = SQL::Open(SQL::MREAD, "Accounts", "Money", -1, "", -1, "", -1, -1, "Money");

But no data in chat!
Update include and try this.

https://github.com/ThreeKingz/easy-m...easy-mysql.inc

PHP Code:
    new string[128], names[24],money;
    new 
handle SQL::OpenEx(SQL::MREAD"Accounts""", -110, -1"Money");
    
SQL::ReadRetrievedRows(handlei)
    {
        
SQL::ReadString(handle"AccountName"names24i);
        
SQL::ReadInt(handle"Money"moneyi);
        
format(stringsizeof(string), "Name %s | Money: %d"names,money);
        
SendClientMessage(playerid, -1string);
    }
    
SQL::Close(handle); 
Max_Andolini is offline   Reply With Quote
Old 23/06/2018, 02:14 PM   #96
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 228
Reputation: 52
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by Max_Andolini View Post
Update include and try this.

https://github.com/ThreeKingz/easy-m...easy-mysql.inc

PHP Code:
    new string[128], names[24],money;
    new 
handle SQL::OpenEx(SQL::MREAD"Accounts""", -110, -1"Money");
    
SQL::ReadRetrievedRows(handlei)
    {
        
SQL::ReadString(handle"AccountName"names24i);
        
SQL::ReadInt(handle"Money"moneyi);
        
format(stringsizeof(string), "Name %s | Money: %d"names,money);
        
SendClientMessage(playerid, -1string);
    }
    
SQL::Close(handle); 
Thanks for this update!

But I get this error:
PHP Code:
...\pawno\include\easy-mysql.inc(191) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(254) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(307) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(370) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(402) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(463) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(516) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(553) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(606) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(638) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2097) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2393) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2407) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2462) : warning 213tag mismatch 
PHP Code:
if(mysql_errno(SQL::ReadCache[i]) != 0
JR_Junior is offline   Reply With Quote
Old 23/06/2018, 02:21 PM   #97
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 327
Reputation: 37
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by JR_Junior View Post
Thanks for this update!

But I get this error:
PHP Code:
...\pawno\include\easy-mysql.inc(191) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(254) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(307) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(370) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(402) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(463) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(516) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(553) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(606) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(638) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2097) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2393) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2407) : warning 213tag mismatch
...\pawno\include\easy-mysql.inc(2462) : warning 213tag mismatch 
PHP Code:
if(mysql_errno(SQL::ReadCache[i]) != 0
Update again.
Max_Andolini is offline   Reply With Quote
Old 23/06/2018, 02:26 PM   #98
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 228
Reputation: 52
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by Max_Andolini View Post
Update again.
Now:
PHP Code:
...\gamemodes\GM.pwn(2046) : error 035argument type mismatch (argument 4
PHP Code:
new handle SQL::OpenEx(SQL::MREAD"Accounts""", -110, -1"Money"); 
JR_Junior is offline   Reply With Quote
Old 23/06/2018, 02:31 PM   #99
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 327
Reputation: 37
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by JR_Junior View Post
Now:
PHP Code:
...\gamemodes\GM.pwn(2046) : error 035argument type mismatch (argument 4
PHP Code:
new handle SQL::OpenEx(SQL::MREAD"Accounts""", -110, -1"Money"); 
PHP Code:
    new string[128], names[24],money;
    new 
handle SQL::OpenEx(SQL::MREAD"Accounts""""""", -110, -1"Money");
    
SQL::ReadRetrievedRows(handlei)
    {
        
SQL::ReadString(handle"AccountName"names24i);
        
SQL::ReadInt(handle"Money"moneyi);
        
format(stringsizeof(string), "Name %s | Money: %d"names,money);
        
SendClientMessage(playerid, -1string);
    }
    
SQL::Close(handle); 
Max_Andolini is offline   Reply With Quote
Old 23/06/2018, 02:41 PM   #100
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 228
Reputation: 52
Default Re: Easy MySQL - Simplifying the usage of MySQL queries!

Quote:
Originally Posted by Max_Andolini View Post
PHP Code:
    new string[128], names[24],money;
    new 
handle SQL::OpenEx(SQL::MREAD"Accounts""""""", -110, -1"Money");
    
SQL::ReadRetrievedRows(handlei)
    {
        
SQL::ReadString(handle"AccountName"names24i);
        
SQL::ReadInt(handle"Money"moneyi);
        
format(stringsizeof(string), "Name %s | Money: %d"names,money);
        
SendClientMessage(playerid, -1string);
    }
    
SQL::Close(handle); 
sorry:
PHP Code:
error 035argument type mismatch (argument 6
EDITD-FIX: new handle = SQL::OpenEx(SQL::MREAD, "Accounts", "", "", "", "", -1, 10, -1, "Money");
JR_Junior 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
[Include] Easy SQLite: Simplyfing the usage of SQLite queries! ThePhenix Includes 7 14/07/2018 10:12 AM
[Include] Easy MySQL 1.0 - Simplifying the usage of MySQL queries! ThePhenix Includes 93 08/01/2017 04:04 AM
[Tutorial] MySQL-queries iRaiDeN Tutorials 2 21/03/2014 03:20 PM
Help with MySQL queries LiamM Scripting Help 4 20/03/2013 10:37 AM


All times are GMT. The time now is 01:12 AM.


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