[Include] Easy MySQL - Simplifying the usage of MySQL queries! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Easy MySQL - Simplifying the usage of MySQL queries! (
/showthread.php?tid=606930)
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
Gammix - 09.07.2019
I like the efforts put in this library but there's a reason why i deleted my EasyDB library(it was built for SQLite with the same purpose as this, before easy_mysql was even released), year(s) ago, because you don't really achieve any advantage using such a syntax, over speed. The biggest reason being you are not using threaded queries and not to mention you limit results because we don't have dynamic memory in default pawn so reading data is limited.
So I won't recommend anyone use this unless you don't care about speed and/or learning SQL.
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
Aerotactics - 17.07.2019
I'm getting errors when using this include. Please look at this thread.
https://sampforum.blast.hk/showthread.php?tid=668001
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
JR_Junior - 18.05.2020
Im trying to use the DATETIME field type but I don't know to use DATE_FORMAT lo convert yyyy-mm-dd to dd-mm-yy with this include.
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
Max_Andolini - 19.05.2020
Version 3.8 released.
Quote:
Originally Posted by CantBeJohn
Great. Can we talk about how these still use the "%e" specifier using normal format instead of mysql_format still though?
PHP Code:
SQL::DeleteRowEx2
SQL::GetStringEntryEx2
SQL::t_GetStringEntryEx2
SQL::GetIntEntryEx2
SQL::GetFloatEntryEx2
SQL::SetIntEntryEx2
SQL::SetStringEntry2
SQL::SetStringEntryEx2
SQL::SetFloatEntryEx2
SQL::RowExistsEx2
SQL::DeleteRow3
Meanwhile, normal format doesn't support "%e"; as shown here ( https://sampwiki.blast.hk/wiki/Format):
The only one it does support is "%q" but that's irrelevant in this case.
Now just look at RowExistsEx2 from the latest version of this library:
PHP Code:
stock SQL::RowExistsEx2(const table[], const column_where[] = "", const row_identifier[], const column_where2[] = "", const row_identifier2[] = "", row_identifier3 = -1, MySQL:connectionHandle = MYSQL_DEFAULT_HANDLE)
{
new query[SQL_FORM_LENGTH], query2[SQL_FORM_LENGTH], Cache:result, rows;
format(query, sizeof(query), "SELECT * FROM `%s` WHERE `%s`='%e'", table, column_where, row_identifier); // HERE.
if(!isnull(column_where2) && !isnull(row_identifier2) && row_identifier3 == -1)
{
format(query2, sizeof(query2), " AND `%s`='%e'", column_where2, row_identifier2); // HERE AS WELL.
strcat(query, query2);
}
if(!isnull(column_where2) && row_identifier3 != -1 && isnull(row_identifier2))
{
format(query2, sizeof(query2), " AND `%s`='%d'", column_where2, row_identifier3);
strcat(query, query2);
}
strcat(query, " ");
result = mysql_query(connectionHandle, query);
if(mysql_errno() != 0)
{
return SQL_Warning("Query could not be completed due to error: %s", query);
}
cache_get_row_count(rows);
cache_delete(result);
if(rows > 0)
{
return rows;
}
return 0;
}
|
Thanks, fixed.
Quote:
Originally Posted by Aerotactics
|
Thanks, fixed.
Quote:
Originally Posted by JR_Junior
Im trying to use the DATETIME field type but I don't know to use DATE_FORMAT lo convert yyyy-mm-dd to dd-mm-yy with this include.
|
It doesn't support getting DATETIME. You can use String as a time.
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
JR_Junior - 20.05.2020
Quote:
Originally Posted by Max_Andolini
It doesn't support getting DATETIME. You can use String as a time.
|
Thank you, I'm saving the date and time as string and works fine.
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
Stefan_Toretto - 22.05.2020
Is there any possibility to add the ability to add table columns to an existing Table?
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
Max_Andolini - 01.06.2020
Quote:
Originally Posted by Stefan_Toretto
Is there any possibility to add the ability to add table columns to an existing Table?
|
Yes, there is. Review examples.
Re: Easy MySQL - Simplifying the usage of MySQL queries! -
JR_Junior - 23.06.2020
What brings about a better performance?
A long handle, with multiple read / write lines?
Or multiple handles with few lines?
Thanks!