not inserting id in the database
#1

mysql_format(mysql, szQuery, 256, "INSERT INTO `clans` (`Name`) VALUES ('%e')", inputtext);
new Cache: result = mysql_query(mysql, szQuery);
new i = cache_insert_id();
cache_delete(result);
PlayerInfo[playerid][pClanid] = i;
this is not inserting a new clan id in the database,i create a clan for the first time and it creates a clan id 0 in the database and that's it,if i try to create anotherone the data base only has the first one;
Reply
#2

you mean this?
new Cache: result = mysql_tquery(mysql, szQuery);
im new into scripting so please have patience with me
Reply
#3

Setup auto increment/primary key for id.
Reply
#4

i've set primaty key for id and it's still not working and auto increament i don;t know how to do that
Reply
#5

Quote:
Originally Posted by bosmania
Посмотреть сообщение
i've set primaty key for id and it's still not working and auto increament i don;t know how to do that
Edit your table structure and set A_I (Auto Increment).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)