Jump to content

install.php help


Recommended Posts

I am a newbie and trying to install a script written in php 5.5 on a godaddy linux hosted server.

 

GoDaddy supports:

 

PHP 4.3.11

MySQL 4.0.24

 

The config.php file is fine, but when I try to run mysite.com/install.php, I get the following error:

 

Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENG

 

This is the beginning of the code where I believe it messes up. Can anybody provide some help? How would I need to tweak this so it works on the supported php version? I have tried taking out DEFAULT CHARSET=latin1, but still does not work.

 

The beginning of the code:

 

<?

require('config.php');

 

if(!is_writable('img/')) { echo '<b><li><font color="f55555">ERROR: </b></li> Please chmod the directory img/ to 777</font> '; }

 

$sql="CREATE TABLE `ads` (

  `id` mediumint(50) NOT NULL,

  `code` text collate latin1_general_ci NOT NULL,

  PRIMARY KEY  (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci";

 

$result = mysql_query($sql) or die('Query failed: ' . mysql_error());

 

$sql="CREATE TABLE `category` (

  `ID` mediumint(9) NOT NULL auto_increment,

  `name` text collate latin1_general_ci NOT NULL,

  `img` text collate latin1_general_ci NOT NULL,

  PRIMARY KEY  (`ID`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=8";

 

$result = mysql_query($sql) or die('Query failed: ' . mysql_error());

 

$sql="CREATE TABLE `ipban` (

  `id` mediumint(9) NOT NULL,

  `ip` text collate latin1_general_ci NOT NULL,

  PRIMARY KEY  (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci";

 

$result = mysql_query($sql) or die('Query failed: ' . mysql_error());

Link to comment
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.