Getting details from MySQL DB with PHP

26 Mar

How to print details from MySQL with PHP :

Note : Replace red marked details:

<?php
mysql_connect("hostname", "username", "password") && mysql_select_db("dbname") or die;
$details = mysql_query("select * from users");
while ($detail = mysql_fetch_assoc($details))
{
$name = $detail['name'];
echo "$name";
}
?>
Advertisements

One Response to “Getting details from MySQL DB with PHP”

  1. Jignesh Patel March 28, 2013 at 6:08 am #

    Reblogged this on RJ Solusoft.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s