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

SatyaPHP
@satyaphp-ZcEgdV โ€ข Oct 26, 2024

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

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform