PDA

View Full Version : Easy MySQL


Matteo987
01/10/2017, 05:04 AM
Hi,

I'm making a house system, so in easy mysql, how to get all the rows in the table "house" ?
Cuz in

new handle = SQL::Open(SQL::READ, "drop", (requires a coulmn here and its format));
there, it requires column name + the format.
So how can I select all the data of all rows using it?

Max_Andolini
01/10/2017, 08:24 AM
Use mine Easy MySQL;

http://forum.sa-mp.com/showthread.php?t=606930

new handle = SQL::Open(SQL::MTREAD, "houses");
SQL_GetCallback(handle, i)
{
SQL::ReadInt(handle, "id", Houses[i][id], i);
SQL::ReadFloat(handle, "h_posx", Houses[i][h_posx], i);
SQL::ReadFloat(handle, "h_posy", Houses[i][h_posy], i);
SQL::ReadFloat(handle, "h_posz", Houses[i][h_posz], i);
}
SQL::Close(handle);//You must close the handle.

Matteo987
01/10/2017, 12:33 PM
I can't open update like this? Tag mismatch error.

new handle = SQL::Open(SQL::UPDATE, "inv", "Name", GetName(playerid));

Max_Andolini
01/10/2017, 02:30 PM
new handle = SQL::Open(SQL::UPDATE, "inv", "Name", GetName(playerid));

SQL::Open for integer

Use SQL::OpenEx

new handle = SQL::OpenEx(SQL::READ, "players", "p_name", ret_pName(playerid));
SQL::ReadString(handle, "p_password", UserInfo[playerid][p_password], 64);
SQL::ReadInt(handle, "p_id", UserInfo[playerid][p_id]);
SQL::Close(handle);