Raised This Month: $ Target: $400
 0% 

SQL column.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 01-09-2013 , 09:36   SQL column.
Reply With Quote #1

hello evreyone,

this code is open the table "psher" and 9 Columns.
PHP Code:
Queries SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS psher( steamid varchar(32), name varchar(32), column1 SMALLINT(1), column2 SMALLINT(1), column3 SMALLINT(1), column4 SMALLINT(1), column5 SMALLINT(1), column6 SMALLINT(1),column7 SMALLINT(1), column8 SMALLINT(1), column9 SMALLINT(1))"
and i thought to do it like this:
PHP Code:
new const tablenames[] = 
{
    
"column1",
    
"column2",
    
"column3",
    
"column4",
    
"column5",
    
"column6",
    
"column7",
    
"column8",
    
"column9"    
}
        
    for(new 
09i++)
    {
        
Queries SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS psher( steamid varchar(32), name varchar(32), %s SMALLINT(1))"tablenames[i])
    } 
but there is a problem i thinks because "CREATE TABLE IF NOT EXISTS" and table is already exists so its won't open another column..
someone has an idea how i can do this in my way( array ) , How to make it work?

thanks for helping
Mr.Waffle is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode