Hello
Im trying to install a new script on my website and this script suppose to create a new DATABASE in MySQL
my question is, why i cant create a database on my own, and why always it adding my "user_name" before the database name
e.g.
"user_name"_DATABASE name
Thanks
Danny
Im trying to install a new script on my website and this script suppose to create a new DATABASE in MySQL
Code:
// Connect to the MySQL server $link = mysql_connect("$ipmysql", "$mysqlusername", "$mysqlpassword"); // Create a new database mysql_query('CREATE DATABASE phpsms'); // Select the new database mysql_query('USE phpsms'); // Create new userdata table mysql_query('CREATE TABLE userdata (userid VARCHAR(100), userpass VARCHAR(100), name VARCHAR(70), address VARCHAR(50), suburb VARCHAR(50), state VARCHAR(50), postcode VARCHAR(6), phone1 VARCHAR(11), phone2 VARCHAR(11), emailaddress VARCHAR(90), joineddate VARCHAR(19), ip VARCHAR(16), userno INT(11), username VARCHAR(20))'); // Create new usersonline table mysql_query('CREATE TABLE usersonline (username VARCHAR(20))'); // Check is there is both tables and then installation is completed $tablecheckuserdata = mysql_query('SELECT * FROM userdata'); $tablecheckuserdata1 = mysql_num_rows($tablecheckuserdata); $tablecheckusersonline = mysql_query('SELECT * FROM usersonline'); $tablecheckusersonline1 = mysql_num_rows($tablecheckusersonline); if ($tablecheckuserdata1 >= 0 && $tablecheckusersonline >= 0) { echo "Installation Complete!"; mysql_close(); // Close the connection to the MySQL Server } else { echo "A error occured, try again"; exit(); }
e.g.
"user_name"_DATABASE name
Thanks
Danny
Comment