here's what I'm trying to do, I'm trying to get a form to make a table in sql. I can't seem to get it though.
Here's what I got
<html><head><title></title></head><body>
<?php
$host = "localhost";
$user = "name";
$password = "password";
$database = "rhs_catalog";
$cantconnectmysqlmessage = "I can't connect to MySQL!!";
$cantconnectdatabasemessage = "I can't connect to the database!!";
$cantmaketablemessage = "I can't make a table in the database!!";
$connectmysql = mysql_connect($host,$user,$password) or die ($cantconnectmysqlmessage);
$db = mysql_select_db($database,$connectmysql) or die ($cantconnectdatabasemessage);
?>
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="newsentry">
<CENTER>
<P ALIGN=CENTER>
<TABLE WIDTH="600" bordercolor="black" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD style="border-bottom-style: solid; border-bottom-width:1"
style="border-right-style: solid; border-right-width: 1"
style="border-top-style: solid; border-top-width:1"
style="border-left-style: solid; border-left-width: 1"
WIDTH="100%" BGCOLOR="#F1F1F1"
VALIGN=center> this is the table name</TD>
</TR>
<TR>
<TD WIDTH="100%" VALIGN=TOP><p>
<textarea name="category" cols="75" rows="1" wrap></textarea>
</p></TD>
</TR>
</TABLE>
<p>
<input type="submit" name="Submit" value="Save Changes">
</p>
</form>
<?
$category = $_POST["category"];
$category = stripslashes($category);
$nametablequery = "CREATE TABLE $category";
$nametable = mysql_query($nametablequery) or die($cantmaketablemessage);
$disconnectmysql = mysql_close($connectmysql);?>
</body></html>
its giving me the form, with the save changes button, but it gives me the "can't make table" error right underneath it. Anyone know how to fix this, or what I'm doing wrong?