strcat and sqlite help
#1

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?

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 
0<600i++)
    {
        if(
== 0) { 1;}
        if(
>= 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); 
print outputs this
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`
Reply


Messages In This Thread
strcat and sqlite help - by new121 - 12.02.2013, 05:25
Re: strcat and sqlite help - by new121 - 12.02.2013, 05:30
Re: strcat and sqlite help - by iggy1 - 12.02.2013, 08:08
Re: strcat and sqlite help - by new121 - 12.02.2013, 10:12
Re: strcat and sqlite help - by new121 - 12.02.2013, 20:11

Forum Jump:


Users browsing this thread: 2 Guest(s)