Jump to content

Database installation


hyipcharts

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/41088-database-installation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.