View Feed
group-icon
PHP Programmers
Community for PHP Programmers : Ask questions, doubts and help each other get better at PHP
299 Members
Join this group to post and comment.
SatyaPHP
SatyaPHP • Jan 29, 2013

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

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 "
";
}

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

Share this content on your social channels -