You cannot create a database from within PHP, you need to connect to mysql server ( my guess is the same applies to MS Access), and with root priviledges call something like
mysql_query("CREATE TABLE nuke_stories ( sid int(11) NOT NULL auto_increment, catid int(11) NOT NULL default '0', aid varchar(30) NOT NULL default '', title varchar(80) default NULL, time datetime default NULL, hometext text, bodytext text NOT NULL, comments int(11) default '0', counter mediumint(8) unsigned default NULL, topic int(3) NOT NULL default '1', informant varchar(20) NOT NULL default '', notes text NOT NULL, ihome int(1) NOT NULL default '0', alanguage varchar(30) NOT NULL default '', acomm int(1) NOT NULL default '0', haspoll int(1) NOT NULL default '0', pollID int(10) NOT NULL default '0', score int(10) NOT NULL default '0', ratings int(10) NOT NULL default '0', PRIMARY KEY (sid) ) TYPE=MyISAM;"); this query you can create at your local computer. You can also use phpMyAdmin, web interface to mysql. Jason Teagle wrote: >----- Original Message ----- >From: "David Freeman" <[EMAIL PROTECTED]> >To: "'PHP Mailing List'" <[EMAIL PROTECTED]> >Sent: Tuesday, June 04, 2002 11:50 AM >Subject: RE: [PHP] MySQL - Creating The Database > > > > >>Ummm, not sure exactly what you're asking but you can use mysql_query to >>issue the relevant sql commands to create your database and tables and >> >> > >Am I correct in saying that none of the SQL functions in PHP can actually >create a database file when no file existed before? In other words, an empty >database file must exist before SQL functions can be called on it? > > > >>so on. In cases where I want to package something that kicks off I >>usually create an install script that looks for the database I need and >>if it doesn't exist then create it. >> >> > >This is the problem - how _do_ you create it? What does your install script >do? Copy a blank template of a DB from a file in your installation package, >or literally create a new file? I have no existing databases to work with... >(what's the file extension for a MySQL-type database anyway [i.e., MS Access >= .MDB, MySQL = ?] ?) > > > >>Obviously if you actually want to test code on your development box then >>you're going to need an actual sql server to do it. >> >> > >That's no problem for me - I'm testing directly on the (remote) host anyway. >Better to test where it's going to be finally then get it all working >perfectly here and find it doesn't work there {:v) > >-------------------------------------------- >_ _ >o o Jason Teagle > < [EMAIL PROTECTED] > v >-------------------------------------------- > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php