hyipcharts Posted March 4, 2007 Share Posted March 4, 2007 Hi all, I am trying ti install my DB, but keep getting a parse error unexpected T_String on line 22. I have used the same method to install another DB with no problems. I think I just need another set of eyes. anyway heres the code and any help would be appreciated: <?php //connect to the database $connect = mysql_connect("localhost", "name", "password") or die ("Hey loser, check your server connection."); //create main database $create = mysql_query("CREATE DATABASE IF NOT EXISTS databasename") or die(mysql_error()); //The new DB is active mysql_select_db("databasename"); //Create Table ads $ads = "CREATE TABLE `ads` ( `ads_id` bigint(20) unsigned NOT NULL auto_increment, `ads_ordering` int(10) unsigned NOT NULL default \"0\", `ads_title` varchar(255) default NULL, `ads_text` varchar(255) default NULL, `ads_expiration` int(10) unsigned default \"0\", `ads_date` date default NULL, `ads_url` text, PRIMARY KEY (`ads_id`) )"; $results = mysql_query($ads) THIS IS LINE 22 or die(mysql_error()); Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/41088-database-installation/ Share on other sites More sharing options...
soadlink Posted March 4, 2007 Share Posted March 4, 2007 Did you forget to put the ?> at the end of your code? Quote Link to comment https://forums.phpfreaks.com/topic/41088-database-installation/#findComment-198974 Share on other sites More sharing options...
hyipcharts Posted March 4, 2007 Author Share Posted March 4, 2007 Did you forget to put the ?> at the end of your code? That was the 1st thing I checked. I have spent the last 5 hours looking at this. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/41088-database-installation/#findComment-198975 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.