![]() |
|
| |||||||
| Notices |
| mySQL & PHP Discussions, information and help with mySQL and PHP. |
![]() |
| | Thread Tools |
|
#1
| ||||
| ||||
|
hi, this is my first try at php and just need to know is this code right as im getting errors but dont know if its my code or the sever side <?php //CONNECT MYSQL and SELECT TABLE; $host = "localhost"; //host name; $username = "test"; //mysql server login name; $password = "test"; //mysql server login password; //database Name; $database = "test"; //PREPARE sql statement; $sql1 = "CREATE DATABASE $database"; //EXECUTE sql statement; $exq1 = mysql_query($sql1); //reply us the database is created or not; if($exq1) { echo "database created"; } else { echo "error while create database"; } ?>
__________________ T12 |
|
#2
| ||||
| ||||
|
VH has Cpanel, which doe NOT allow creation of Databases through a query. You need to create your database through CPanel.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#3
| ||||
| ||||
|
You should be able to create the database manually through a script, using your cpanel username/password in the script.
__________________ Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |
|
#4
| ||||
| ||||
|
Hm.... I can't be certain, but i believe not. Even phpMyAdmin which by default uses the cpanel usename / password, has privilleges to create a new database.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |