Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.