Hi,
Hope you guys can help me out~~ I have a config.php file. I want to
conncet to my own mysql version. When i run the config.php file as
below, i get all successful message. However, when i take a look the
database information in doc environment, I don't see any database or
table created.
<html>
<head><title>Cr eate Database and table</title></head>
<body>
<?php
//connect to the database, write, and execute the query
$linkID = mysql_connect(" localhost", "", "") or die ('I cannot connect
to the
database because: ' . mysql_error());
if (!$_GET['linkID'])
{
print("The connection to the server was made successfully.<b r>");
}
else
{
print("The connection to the server failed.<br>");
}
mysql_close($_G ET['linkID']);
$DBName="Krista ";
$TableName = "Employee";
//connect to the database, write, and execute the query
$Link = mysql_connect(" localhost",""," ");
mysql_select_db ("Krista", $_GET['Link']);
$resultID = mysql_query ("CREATE table Employee(Employ eeID INT
UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
Employee_Name TEXT",$_GET['Link']);
if(!$_GET['resultID']){
print("The query was successfully executed!<BR>\n ");
}
else{
print("The query could not be executed!<BR>\n ");
}
mysql_close($_G ET['Link']);
?>
</body>
</html>
In addition, i change the global_register to on. However, I still need
to use $_GET['username'] like this. I want to use $username instead of
$_GET['xxx'].
Thanks,
Krista
Hope you guys can help me out~~ I have a config.php file. I want to
conncet to my own mysql version. When i run the config.php file as
below, i get all successful message. However, when i take a look the
database information in doc environment, I don't see any database or
table created.
<html>
<head><title>Cr eate Database and table</title></head>
<body>
<?php
//connect to the database, write, and execute the query
$linkID = mysql_connect(" localhost", "", "") or die ('I cannot connect
to the
database because: ' . mysql_error());
if (!$_GET['linkID'])
{
print("The connection to the server was made successfully.<b r>");
}
else
{
print("The connection to the server failed.<br>");
}
mysql_close($_G ET['linkID']);
$DBName="Krista ";
$TableName = "Employee";
//connect to the database, write, and execute the query
$Link = mysql_connect(" localhost",""," ");
mysql_select_db ("Krista", $_GET['Link']);
$resultID = mysql_query ("CREATE table Employee(Employ eeID INT
UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
Employee_Name TEXT",$_GET['Link']);
if(!$_GET['resultID']){
print("The query was successfully executed!<BR>\n ");
}
else{
print("The query could not be executed!<BR>\n ");
}
mysql_close($_G ET['Link']);
?>
</body>
</html>
In addition, i change the global_register to on. However, I still need
to use $_GET['username'] like this. I want to use $username instead of
$_GET['xxx'].
Thanks,
Krista
Comment