Tuesday, November 23, 2010

Let Learn PHP (Basic) - Lesson 3

After you got the connection to the database, it time to select the table in the database to your page..let see how it does...



$query = "SELECT name, subject, message FROM contact";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name : {$row['name']} <br>" .
"Subject : {$row['subject']} <br>" .
"Message : {$row['message']} <br><br>";
}

isn't it simple...:-) 

4 comments:

LinkWithin

Related Posts Plugin for WordPress, Blogger...