Jump to content

MySQL Error


c_pattle

Recommended Posts

Hey everyone. I'm trying to simply just create a php document that allows me to create a database using MySQL. I've copied my code below (password for mysql is correct but I wanted to hide it).

 

<?php

 

$conn = mysql_connect("localhost","root","******") or die ("Sorry");

 

$rs1 = mysql_create_db ( $_REQEUST['db'] );

 

$rs2 = mysql_list_db ($conn );

for( $row = 0; $row < mysql_num_rows ($rs2); $row++) {

$list.= mysql_tablename( $rs2, $row) . " - ";

}

?>

 

<html>

<head>

<title>Title</title>

</head>

 

<body>

<form action="<?php echo ( $_SERVER['PHP_SELF'] ); ?>" method="post">Current Databases: <?php echo ( $list); ?>

<hr>Name:<input type="text" name"db">

<input type="submit" value"Create Database">

</form>

</body>

</html>

 

When I try to run the page I get this error "Fatal error: Call to undefined function mysql_create_db() in /var/www/test2.php on line 5"

 

Does anyone know why this is happening?

 

Thanks for any help

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.