MySQL ID
#1

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?
Reply
#2

You're not fetching it as its supposed to.
Reply
#3

PHP код:
format(stringsizeof(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_SQLquerysizeof(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], iXiYiZXYZvwinterior);
    
mysql_tquery(g_SQLquery"OrgsCache""i"org);
forward OrgsCache(org);
public 
OrgsCache(org)
{
    
OrgInfo[org][oID] = cache_insert_id();
    
Iter_Add(i_Orgsorg);
    return 
1;

Reply
#4

If it inserts fine into db... then you gotta show us SELECT.
Reply
#5

I need select?? Noone told me that..
Reply
#6

Quote:
Originally Posted by Micko123
Посмотреть сообщение
PHP код:
format(stringsizeof(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_SQLquerysizeof(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], iXiYiZXYZvwinterior);
    
mysql_tquery(g_SQLquery"OrgsCache""i"org);
forward OrgsCache(org);
public 
OrgsCache(org)
{
    
OrgInfo[org][oID] = cache_insert_id();
    
Iter_Add(i_Orgsorg);
    return 
1;

This inserts into database the information.... but dont you think you need to fetch it later on? to use it...
Reply
#7

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_SQLquerysizeof(query), "UPDATE `orgs` SET `Name` = %s WHERE `ID` = %d LIMIT 1"orgnameOrgInfo[org][oID]);
    
mysql_tquery(g_SQLquery); 
It is not affected. It changes IG but not in DB
Reply
#8

%s = '%s'
Reply
#9

Should I do that everytime for everything??
Or only for strings??
Reply
#10

Okay so name is fixed. But I don't still get this with ID.. Have no idea how to do it..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)