View Single Post
Old October 18th, 2003, 12:36 PM   #2 (permalink)
AlexH
Peaches!
Excelling Contributor
 
Joined in Jul 2003
Lives in Ottawa, Ontario, Canada
Hosted on Jose, Pass19
564 posts
Gave thanks: 0
Thanked 0 times
For those of you who don't have SSH access, can create their database by creating a file called createdb.php. In this file place the following code:
Code:
<?php
$link = mysql_connect("localhost", "cpanelusername_mysqlusername", "cpanelusername_mysqlpassword") or die(mysql_error());
mysql_select_db("cpanelusername_mysqldatabase", $link) or die(mysql_error());
$query = mysql_query("CREATE TABLE 'user' ( 'name' VARCHAR (20), 'password' VARCHAR (20), 'ID' INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (ID))", $link) or die(mysql_error());
if ($query) echo "Table Created";
?>
Be sure to change cpanel_username to the username that you open cPanel with, mysqlusername to the user that you created for this database, mysqlpassword with the password for that user, and mysqldatabase with the name of the database that this user has access to. Run this script in your browser. If it gives you a message saying Table Created the creation was successful. Once it is created, DELETE THIS FILE IMMEDIATELY, by not deleting it, you are leaving a large security whole open.
__________________
alex.honeywell [ seigousei.net - pass19, binuweb.com - jose ]
AlexH is offline