May
31

While using PHP, you can run MYSQL SELECT.

The following will show you to retrieve data from mysql_fetch_array()

include ‘config.php’;
include ‘opendb.php’;

$query = “SELECT name, subject, message FROM contact”;
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo “Name :{$row['name']}
” .
“Subject : {$row['subject']}
” .
“Message : {$row['message']}

“;
}

include ‘closedb.php’;
?>

The following will show you how to retrieve data from mysql_fetch_assoc()

include ‘config.php’;
include ‘opendb.php’;

$query = “SELECT name, subject, message FROM contact”;
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
echo “Name :{$row['name']}
” .
“Subject : {$row['subject']}
” .
“Message : {$row['message']}

“;
}

include ‘closedb.php’;
?>

Comments Off    Read More   

Comments are closed.