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
https://forums.phpfreaks.com/topic/39531-installphp-help/
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.