PHP/MySQL Help. Unable to connect to DB and receiving error?

paypal

New member
I'm trying to connect locally via php and am receiving this error:

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 in C:\xampp\htdocs\lg.php on line 2

Here's the code:

<?php
$conn = mysql_connect("127.0.0.1:9898", "root", "password");
//This is the conflicting line, the db is listening on port 9898 btw.

mysql_select_db("my_sql");

$query = "SELECT * FROM people";

$result = "mysql_query($query)";

while($person = mysql_fetch_array($result)) {
echo "<h3>".$person['Name']."</h3>";
}
?>

Evidently I'm unable to connect. The connection attempt takes about a minutes before it finally times out and this error follows the first:

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\lg.php on line 2

I'm using xampp. Anyone know of the problem?
 
Back
Top