Hello,
I am a newbie with all this database stuff and I need some help. I am trying to make up a script that will create a table and begin the installation of data to a mySQL database.
This will be for a phpNuke site.
I attempted to run the script below but I have the following problems.
1. The page is completely white with no printing at all after calling the page except for the error noted below.
2. I keep getting a "parse error" at line 46. that refers to the following line of script,
FULL CODECode:did int(10) NOT NULL auto_increment,
What am I doing wrong???PHP Code:<?php
################## BEGIN THE FILE ##################
require_once("mainfile.php");
global $prefix, $dbi;
if (!is_admin($admin)) { die ("Sorry you are not an administrator, You can not install this module"); }
/*********************************************************/
/* Configuration Variables */
/*********************************************************/
require("config.php");
$host = $dbhost;
$database = $dbname;
$username = $dbuname;
$password = $dbpass;
mysql_connect($host, $username, $password);
@mysql_select_db($database);
################## BEGIN THE INSTALL ##################
echo"<P>";
echo"<P>";
OpenTable();
echo"<B>AUTOMATED WEB DATABASE INSTALL</B>";
echo"<P>";
#
# Dropping Old Database if necessary`
#
echo"Dropping Old DB If Necessary<br>";
mysql_query("DROP TABLE IF EXISTS $prefix"._abc."");
echo"Dropped Old DB<br>";
#
# Table structure for table `nuke_abc`
#
echo"Creating New Table<br>";
mysql_query("CREATE TABLE $prefix"._abc. (
did int(10) NOT NULL auto_increment,
dic_word varchar(40) NOT NULL default '',
dic_def text NOT NULL,
PRIMARY KEY (did)
)");
echo "ABC Table Created"<br>";
?>
Thanks in advance for any and all responses.
WP1





Bookmarks