Hi Herman,

     I am myself a pro at PHP, but I think, this would be of some help to you.

To create a Table, you won't find a comand in PHP.  However what you do is build a 
CREATE TABLE statement and pass that as an
argument to mysql_query() function to do the job.

Here is a small example:

mysql_connect($dbhost,$dbuser,$dbpassword) or die("Couldn't Connect);
mysql_select_db($dbname);

$query = "CREATE TABLE YOUR_TABLE (
                                                                            COL1 INT 
NOT NULL PRIMARY KEY,
                                                                            COL2 TEXT
                                                                        );

mysql_query($query) or die(mysql_error);

Just a small tip.  You can use phpmyadmin utility to these sorts of job in a jiffy.

I hope this helps!


Subodh Gupta
I have learned, Joy is not in things, it is in us.
You will ultimately be known by what you give and not what you get.

----- Original Message -----
From: "Herman Wapenaar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 25, 2001 11:30 AM
Subject: [PHP-DB] Creating tables


Hi everyone

I am using a website based in the states to which is PHP enabled. I am using
MySQL.

Is there a way to create a table with PHP? I do not see any command for
that.

I have loaded MySQL for Windows but the server runs MySQL on Unix. I don't
know if the file structure is different. Maybe that is why I can not read
it?

Thanks
Herman Wapenaar



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to