17.12.2016, 22:05
Hello, I'm trying to combine two tables in MySQL.
Code:
But the last id is 0 everytime. In the table Phones I have an ID row with AUTO_INCREMENT.
In Server I can't make the 'phoneid' as AUTO_INCREMENT because I don't insert only phones...
Any help?
Code:
Код:
new query[400]; mysql_format(handle, query, sizeof(query), "INSERT INTO Phones SET Number = '%i'", phone); mysql_tquery(handle, query, "", ""); // Tried InsertPhone here but same result InsertPhone(number, cache_insert_id()); public InsertPhone(number, lastid) { new query[400]; mysql_format(handle, query, sizeof(query), "INSERT INTO ServerObjects (number, phoneid) VALUES ('%i', '%d')", number, lastid); mysql_query(handle, query); }
In Server I can't make the 'phoneid' as AUTO_INCREMENT because I don't insert only phones...
Any help?