ORM Vehicle System - inserting a row - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ORM Vehicle System - inserting a row (
/showthread.php?tid=578741)
ORM Vehicle System - inserting a row -
ben1 - 21.06.2015
Worked it out...
Re: ORM Vehicle System - inserting a row - justice96 - 21.06.2015
Quote:
Originally Posted by ben1
Hi,
Under OnGameModeInit
Код:
print("ABOUT TO RUN LOADVEHICLES");
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `vehicles`");
mysql_tquery(mysql, query, "LoadVehicles", "");
|
Код:
mysql_pquery(your database,"SELECT * FROM `your_database` ORDER BY `vehicleid` ASC","LoadVehicles","");
or
Код:
mysql_tquery(your database, "SELECT * FROM `your_database`", "LoadVehicles", "");
Re: ORM Vehicle System - inserting a row -
Konstantinos - 21.06.2015
I suggest you to re-read AndreT's tutorial:
https://sampforum.blast.hk/showthread.php?tid=461766
About inserting a new row:
https://sampwiki.blast.hk/wiki/MySQL/R33#orm_insert
Re: ORM Vehicle System - inserting a row -
ben1 - 22.06.2015
Hi,
That doesn't really help... And the thing on the wiki doesn't make much sense to me - hence me posting on here...
Re: ORM Vehicle System - inserting a row -
Konstantinos - 22.06.2015
You assign data to vInfo and you call orm_insert function - all the rest are done itself.
Re: ORM Vehicle System - inserting a row - justice96 - 22.06.2015
You forgot to add your connection database, it should be filled
Код:
new TotalVehs = cache_num_rows(connection database);
Try now.
EDIT:
Код:
new ORM:ormid = vInfo[r+1][ORM_ID] = orm_create("vehicles",connection database);