<?php mysql_connect("localhost", "admin", "") or die(mysql_error()); echo "Connected to MySQL<br />"; mysql_select_db("globall") or die(mysql_error()); echo "Connected to Database"; $query = " SELECT user_name, mobile " . "FROM customer "; echo "<br>" ; $result = mysql_query($query,$link) or die(mysql_error()); // this will count the total user in database $num_users = mysql_num_rows($result); $table_header =<<<EOD <h2><center>GLoBALL Users Database </center></h2> <table width="100%" border="1" cellpadding="2" cellspacing="2" align="center"> <tr> <th>Username</th> <th>Mobile</th> </tr> EOD; $user_details = ''; while ($row = mysql_fetch_array($result)) { $user_name = $row['user_name']; $mobile = $row['mobile']; $user_details .=<<<EOD <tr> <td>$user_name</td> <td>$mobile</td> </tr> EOD; $user_details .=<<<EOD <tr> <td> </td> <td>Total : $num_users</td> </tr> EOD; } ?>
$link=mysql_connect("localhost", "admin", "") or die(mysql_error());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)