my php code not working for if condition else part only working

<?php include("db.php"); $result=mysql_query("SELECT * FROM members"); echo""; echo""; echo""; echo""; echo""; echo""; echo""; echo""; echo""; while($test = mysql_fetch_array($result)) { if(empty($test)) { echo "no records"; } else { $id = $test['username']; echo""; echo""; echo""; //echo""; echo""; echo""; echo""; echo""; } } mysql_close($conn); ?>
" .Name."" .Username."" .Email."" .Phone."" .Status."" .Action."
" .$test['name']."" .$test['username']."" .$test['password']."". $test['email']. "". $test['phone']. "". $test['status']. " Edit"; echo" Delete"; echo"

First, update your code to use PDO. We cannot support old unsecure mysql_* anymore. You can also use mysqli but your better off with PDO.

I have posted complete working and bug free working PDO files to get you going. Just modify the query’s to match your database and you will be up and running to current coding. We will be happy to help you once you do that.

http://www.phphelp.com/forum/the-occasional-tutorial/beginners-pdo-bumpstart-code-use-it-now!/?PHPSESSID=03k85erh9n2g4gsiuc6v5urkr3

Also, you need to use stylesheets. This code is no good:
font color=‘black’
valign=‘center’
cellspacing=‘2’
cellpadding=‘2’

Sponsor our Newsletter | Privacy Policy | Terms of Service