Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\dbconnect.php on line 2
this is the index file'code (file name:sign.php):
- Code: Select all
<HTML>
<TITLE>let's sign in</TITLE>
<HEAD
<BODY>
<h2>Sign in to myt guestbook!</h2>
<form method=post action="create_entry.php">
<b>Name:</b>
<input type=text size=40 name=name>
<br>
<b>Location:</b>
<input type=text size=40 name=location>
<br>
<b>Email:</b>
<input type=text size=40 name=email>
<br>
<b>Home page URL:</b>
<input type=text size=40 name=url>
<br>
<b>Comments:</b>
<textarea name=comments cols=40 rows=4 wrap=virtual></textarea>
<br>
<input type=submit name=submit value="Submit">
<input type=reset name=reset value="Reset">
</form>
then the create_entry.php code:
- Code: Select all
<?php include("dbconnect.php");
if($submit=="Submit")
{
$query="insert into guestbook
(name,location,email,url)values
('$name','$location','$email','$url')"
;
mysql_query($query) or
die (mysql_error());
?>
<h2>Thanks</h2>
<h2><a href="view.php">View my guestbook!</a></h2>
<?php
}
else
{
include("sign.php");
}
?>
then dbconnect.php code:
- Code: Select all
<?php
mysql_connect("localhost","guestbook","mysql") or
die ("Could not connect to database");
mysql_select_db("guestbook") or
die ("Could not select database");
?>
any teacher,please help me to solve this problem...
thank you......[/code]



