ORM Vehicle System - inserting a row
#1

Worked it out...
Reply
#2

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", "");
Reply
#3

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
Reply
#4

Hi,
That doesn't really help... And the thing on the wiki doesn't make much sense to me - hence me posting on here...
Reply
#5

You assign data to vInfo and you call orm_insert function - all the rest are done itself.
Reply
#6

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)