Hello,

I'm trying to create a table from a PHP script.
>From what I read in my book about PHP and MySQL I
should do something like that:

$sql_query="CREATE TABLE '$num' (
               'variable1'                mediumint(6)          unsigned NOT
NULL,
                
               'variable2'        smallint(6)           unsigned NOT NULL,
               PRIMARY KEY(numero),
               )";
First I tried without the 'primary key' and the '' for
the names of the variables. My script was not creating
the table so I decided to add the '' and the "primary
key". It was still not working. Then I've found that
this is working:

$sql_query = 'CREATE TABLE $num ('
        . ' `variable1` DATE NOT NULL'
        . ' )'; 

I'd like to know why my first test was not working
(cause it is similar to a listing in a book) and if I
really need (it's related) to use the '.' between each
line of my command?

Another problem is that the table is created with the
name $num and is not replaced like I want by its
value. How can I solve this other problem?

Thanks a lot for your help.


        

        
                
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com




The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to