MySQL Forums
Forum List  »  PHP

Fatal error message
Posted by: Daniel Hartley
Date: January 04, 2006 08:09PM

I really need help, I newbie at actually writting php and Mysql stuff, but im stuck on this script to connect to and server each time i run it, it comes up with:

Fatal error: Call to undefined function mysql_connect()

here's the script im tring to make is it ok if someone could help, thanks.

<?php
$host="localhost";
$username="root";
$password="pass";
$db_name="test";
$tbl_name="forum_question";

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
?>

Options: ReplyQuote


Subject
Written By
Posted
Fatal error message
January 04, 2006 08:09PM
January 05, 2006 07:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.