RE: [PHP] about mySQL

From: Date: Thu, 26 Oct 2000 02:43:58 +0000
Subject: RE: [PHP] about mySQL
Groups: php.general 
Request: Send a blank email to php-general+get-22020@lists.php.net to get a copy of this message
Yes, use a CREATE TABLE statement I generally wrap my stuff around like this, that way you can see the errors! <?php $db_domain = ""; //Domain name mysql is running on $db_user = ""; //Your mysql user name here $db_password = ""; //your mysql password here $db_databasename = ""; //your database name $db = mysql_connect($db_domain, $db_user,$db_password); mysql_select_db($db_databasename,$db); $sqlstring =" CREATE TABLE guestbook ( ID INT NOT NULL AUTO_INCREMENT, SiteID INT, GBName CHAR(255) BINARY, GBHomeTown CHAR(255) BINARY, GBHomeNow CHAR(255) BINARY, GBEmail CHAR(255), GBUpTo MEDIUMTEXT, GBWebSiteURL MEDIUMTEXT , GBSpeak MEDIUMTEXT , GBDate TimeStamp, KEY (ID) ) "; $result=mysql_query($sqlstring,$db); if ($result) { echo "Done"; } else { echo "Problem:"; echo mysql_error() . "\n<br>"; } -----Original Message----- From: Anna [mailto:AnnaM@i-dizains.lv] Sent: October 25, 2000 08:48 PM To: php-general@lists.php.net Subject: [PHP] about mySQL does there exist possibility create table via php script (I found about db creation.......) AnnA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#22020) next »