MySQL ID -
Micko123 - 14.11.2016
I have problem with ID. When I create org it is created with ID 0 on server and with ID 1 in DB. As soon as I edit it it changes to ID 1 but server is treating it as 0 and changes are not affected..
Any ideas?
Re: MySQL ID - iLearner - 14.11.2016
You're not fetching it as its supposed to.
Re: MySQL ID -
Micko123 - 14.11.2016
PHP код:
format(string, sizeof(string), ""SERVERBLUE"ID: %d\n"SERVERBLUE" - %s -\n"SERVERBLUE"Leader: "WHITE"%s\n"SERVERBLUE"To enter press 'F' or 'ENTER'", OrgInfo[org][oID], OrgInfo[org][oName], OrgInfo[org][oLeader]);
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `orgs` (`Name`, `Leader`, `ExitX`, `ExitY`, `ExitZ`, `IntX`, `IntY`, `IntZ`, `VW`, `Interior`) VALUES ('%s', '%s', %f, %f, %f, %f, %f, %f, %d, %d)", OrgInfo[org][oName], OrgInfo[org][oLeader], iX, iY, iZ, X, Y, Z, vw, interior);
mysql_tquery(g_SQL, query, "OrgsCache", "i", org);
forward OrgsCache(org);
public OrgsCache(org)
{
OrgInfo[org][oID] = cache_insert_id();
Iter_Add(i_Orgs, org);
return 1;
}
Re: MySQL ID - iLearner - 14.11.2016
If it inserts fine into db... then you gotta show us SELECT.
Re: MySQL ID -
Micko123 - 14.11.2016
I need select?? Noone told me that..
Re: MySQL ID - iLearner - 14.11.2016
Quote:
Originally Posted by Micko123
PHP код:
format(string, sizeof(string), ""SERVERBLUE"ID: %d\n"SERVERBLUE" - %s -\n"SERVERBLUE"Leader: "WHITE"%s\n"SERVERBLUE"To enter press 'F' or 'ENTER'", OrgInfo[org][oID], OrgInfo[org][oName], OrgInfo[org][oLeader]);
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `orgs` (`Name`, `Leader`, `ExitX`, `ExitY`, `ExitZ`, `IntX`, `IntY`, `IntZ`, `VW`, `Interior`) VALUES ('%s', '%s', %f, %f, %f, %f, %f, %f, %d, %d)", OrgInfo[org][oName], OrgInfo[org][oLeader], iX, iY, iZ, X, Y, Z, vw, interior);
mysql_tquery(g_SQL, query, "OrgsCache", "i", org);
forward OrgsCache(org);
public OrgsCache(org)
{
OrgInfo[org][oID] = cache_insert_id();
Iter_Add(i_Orgs, org);
return 1;
}
|
This inserts into database the information.... but dont you think you need to fetch it later on? to use it...
Re: MySQL ID -
Micko123 - 14.11.2016
Any hint to do it?? I am still new at MySQL..
And I am confused that name is not saved in DB
PHP код:
mysql_format(g_SQL, query, sizeof(query), "UPDATE `orgs` SET `Name` = %s WHERE `ID` = %d LIMIT 1", orgname, OrgInfo[org][oID]);
mysql_tquery(g_SQL, query);
It is not affected. It changes IG but not in DB
Re: MySQL ID - iLearner - 14.11.2016
%s = '%s'
Re: MySQL ID -
Micko123 - 14.11.2016
Should I do that everytime for everything??
Or only for strings??
Re: MySQL ID -
Micko123 - 14.11.2016
Okay so name is fixed. But I don't still get this with ID.. Have no idea how to do it..