12.02.2013, 05:25
Okay so I am trying to set up these fields in the table "Obj1X","Obj1Y","Obj1Z" and so on all the way to Obj600X can anyone tell me why this isn't working?
print outputs this
PHP код:
new bstring[256],query[138],final[5000];
db_free_result(db_query(houses,"CREATE TABLE IF NOT EXISTS `Houses`(`EnterX`,`EnterY`,`EnterZ`,`EnterVw`,`EnterInt`,`Set`,`Owned`,`Price`,`ExitX`,`ExitY`,`ExitZ`,`ExitVw`,`ExitInt`,`Owner`"));
format(bstring,sizeof(bstring),"CREATE TABLE IF NOT EXISTS `Furniture` (`Owner`,",21);
strcat(query,bstring,1500);
for(new i = 0; i <600; i++)
{
if(i == 0) { i = 1;}
if(i >= 1)
{
format(bstring,sizeof(bstring),"`Obj%dX`,`Obj%dY`,`Obj%dZ`,`Obj%dRx`,`Obj%dRy`,`Obj%dRz`,",i,i,i,i,i,i);
strcat(query,bstring,1500);
}
}
format(final,sizeof(final),"%s`Vw`",query);
db_query(houses,final);
printf("%s",final);
PHP код:
CREATE TABLE IF NOT EXISTS `Furniture` (`Owner`,`Obj1X`,`Obj1Y`,`Obj1Z`,`Obj1Rx`,`Obj1Ry`,`Obj1Rz`,`Obj2X`,`Obj2Y`,`Obj2Z`,`Obj2Rx`,`Obj2R`Obj599X`,`Obj599Y`,`Obj599Z`,`Obj599Rx`,`Obj599Ry`,`Obj599Rz`,`Obj599X`,`Obj599Y`,`Obj599Z`,`Obj599Rx`,`Obj599Ry`,`Obj599Rz`,`Vw`)