PHP error when using mysql related functions

mabelzpy

New Member
I have another script that I can't figure out what is wrong with it. I attempted to use the\[code\]error_reporting(E_ALL);\[/code\]to report the errors, but it doesn't report anything. Anyway, here is the code I'm having trouble with.\[code\]<?phperror_reporting(E_ALL);$username = $_POST['user'];$email = $_POST['email'];$password = md5($_POST['pass']);$currname = $_COOKIE['ZBrownTechnologyCorporationBeta'];$con = mysql_connect("HOST", "USER", "PASS");if (!$con) { die('Unable to connect: '.mysql_error());}mysql_select_database("zach_blogin", $con);if(empty($password)) { $nothing = "nothing";} else { mysql_query("UPDATE members SET password = '$password' WHERE username = '$currname'");}mysql_query("UPDATE members SET Email = '$email' WHERE username = '$currname'");if($username==$currname) { $nothing = "nothing";} else { $query = ("SELECT username from members WHERE username = '$username'"); $result = mysql_query($query); if (!$result) { header("Location: " . $_SERVER['HTTP_HOST'] . "/public_html/Beta/account.php?invalid"); exit; }}mysql_query("UPDATE members SET username = '$username' WHERE username = '$currname'");header("Location: ". $_SERVER['HTTP_HOST'] . "/public_html/Beta/main_login.php?update");?>\[/code\]I have looked over this code for a while now. Can't seem to get the error reporting to work, so here I am again. Thanks to everyone who has helped, and who will help!By Request of @Klinky:When attempting to use this page (named myinfo.php ) in Opera, it displays the default message indicating that it is not able to find the page and/or the server. In Internet Explorer 8, it displays a 500 Internal Server Error.Here are the server specs:OS: LinuxHTTP: Apache v2.0.63PHP: 5.3.3MySQL: 5.0.91-communityI looked in the logs, and this is the error message:\[code\][Sat Sep 25 21:34:08 2010] [error] [client 68.52.52.190] PHP Fatal error: Call to undefined function mysql_select_database() in /home/zach/public_html/Beta/myinfo.php on line 12, referer: http://zbrowntechnology.com/Beta/account.php\[/code\]The only thing is, the database I tried to select does exist!
 
Back
Top