I'm trying to write an install file for a guy I know and I'm getting an error when I try to run it:
Table 'tdungeon_dictionary.users' doesn't exist
I have no idea why it's saying that since I'm trying to get it to create the table.
Here is my current code:
<?php
include 'include.php';
$page_title = 'Updating the database';
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';
$host = "localhost";
$user = "user";
$pass = "pass";
$db = "db";
mysql_connect($host, $user, $pass);
mysql_select_db($db);
$sql = array();
$sql[] = "CREATE TABLE conlang (
con_word text NOT NULL,
type text NOT NULL,
eng_word text NOT NULL,
root text,
con_phrase text NOT NULL,
eng_phrase text NOT NULL,
xs text NOT NULL,
text_title text NOT NULL,
text_con text NOT NULL,
text_eng text NOT NULL,
text_trans text NOT NULL,
user text NOT NULL,
FULLTEXT KEY eng_phrase (eng_phrase)
) TYPE=MyISAM";
$sql[] = "CREATE TABLE users (
username text NOT NULL,
password text NOT NULL,
LEVEL int(11) NOT NULL default '0',
datab text NOT NULL,
conlang_name text NOT NULL,
FULLTEXT KEY username (username)
) TYPE=MyISAM";
for( $i = 0; $i < count($sql); $i++ )
{
if( !$result = $db->sql_query ($sql[$i]) )
{
$error = $db->sql_error();
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successful</b></font></li><br />';
}
}
echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
echo '<tr><th>Installation Complete</th></tr><tr><td><span class="genmed">Please be sure to delete this file.</span></td></tr>';
?>
Can someone help me out?