Home > Scripts > Fetch Data From MYSQL Using PHP

Fetch Data From MYSQL Using PHP

November 16th, 2008

$query = “SELECT * FROM table”;
$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row['column1']. ” - “. $row['column2']. “
“;
}

This script will come in handy for the new PHP Programmer. You can fetch information from the database and display it directly to your browser. These scripts are made for simplicity. I may someday write a tutorial but as you know there are plenty of tutorials for a PHP Programmer.

Scripts

  1. No comments yet.
  1. No trackbacks yet.