1. Home >
  2. Apps >
  3. Groups >

How to fetch data from existing table using PHP while I'm using XAMPP

Question asked by SatyaPHP in #PHP on Jan 29, 2013
SatyaPHP
SatyaPHP · Jan 29, 2013
Rank E2 - BEGINNER
Hi All,

I'm fresher in PHP and I want to learn PHP very well..............Please help.........

I'm facing problem to fetch data from my existing table using below code:

mysql_select_db("my_db",$con);

$result = mysql_query("SELECT * FROM Persons");


while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br/>";
}

mysql_free_result($result);


And the Browser displayed the below error message


Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\learn\selectData.php on line 25 Posted in: #PHP

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up