Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsZymic Free Web HostingDatabases & MySQL right
  Reply to this topic Start new topic
left right
ztforward
post May 25 2009, 10:22 PM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 21-May 09
Member No.: 96,070



Hi Everyone,

I have a problem to create a database using PHP in my website in Zymic, though I have no problem to do so in my own computer which has the Apache, PHP and MYSQL installed. But in my mechine, I need to use "root" to replace "myusername" to make this work. After I uploaded my codes with some modifications of my username and my password, the code did not work. I have no problem in creating databases using my database management panel of this website. I am just curious about whether I can use PHP codes to create databases. I am just wondering whether I have the privilege to create database using PHP. The following is the codes I used. Could anybody give some help on this?

php
$mysqli = new mysqli("localhost", "myusername_myusername", "mypassword");

if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
} else {
echo " First, connected!!!";
}

$sql0 = "CREATE DATABASE myusername_ttt99";
$res = mysqli_query($mysqli, $sql0);

if($res){
echo " SUCCESS!!!!!!!";
}

mysqli_close($mysqli)
?>

Thank you very much. Your kind help is highly appreciated!

Go to the top of the page 
 
  + Quote Post
swordz
post May 25 2009, 11:14 PM
Post #2


Outrageously Uber Ninja
*******

Group: Moderators
Posts: 1,740
Joined: 10-July 08
From: UK
Member No.: 44,994



I'm afraid you don't have the permissions to create db's/users - you can only use the db management we give you.

swordz
Go to the top of the page 
 
  + Quote Post
ztforward
post May 25 2009, 11:24 PM
Post #3


Newbie
*

Group: Members
Posts: 2
Joined: 21-May 09
Member No.: 96,070



QUOTE(swordz @ May 25 2009, 11:14 PM) *
I'm afraid you don't have the permissions to create db's/users - you can only use the db management we give you.

swordz



Thank you very much for your prompt reply. That clears things up. I appreciate.
Go to the top of the page 
 
  + Quote Post
 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 21st November 2009 - 01:03 PM