|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hello, i am currently trying to make a piece of PHP code that allows me to make a database when i click a button i have the following code but it doesn't seem to work ( i have obviously put in my own mysql details ect ).
Code:
<?PHP
// Connects to your Database
mysql_connect("localhost", "my_user", "password") or die(mysql_error());
mysql_select_db("my_db") or die(mysql_error());
if ($_POST['submit']) {
// command to make database
$sql = ("CREATE DATABASE my_db");
// creates the database
mysql_query($sql);
// database created message
echo "Database created sucessfully";
}
else {
// datebase not created message
echo "Database creation failed";
}
?>
<html>
<body>
<div align="center">
<form name="form1" method="post" action="">
<label>
<input name="submit" type="submit" id="submit" value="Install">
</label>
</form>
</div>
</body>
</html>
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Which one? PHP or MySQL | dak888 | Database Discussion Forum | 17 | 11-29-2007 03:26 AM |
| CSV to mySQL | richkoi | Database Discussion Forum | 14 | 09-14-2006 04:42 PM |
| MySQL 5.0 is out | TrafficProducer | Database Discussion Forum | 15 | 11-29-2005 11:12 AM |
| NEW TO PHP mySQL | richkoi | Database Discussion Forum | 0 | 06-05-2005 05:27 PM |
| MySQL 4.1 | case510 | Database Discussion Forum | 2 | 04-17-2004 06:42 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |