rawky1976 Posted September 6, 2007 Share Posted September 6, 2007 Hello all Im struggling with a blank page that is solved by commenting out a while loop within an if statement. The first line is a conditional that checks if a hidden field is TRUE. If the page is 'first load' it should be false and drop straight down to display a form. If the form has been submitted it should handle. Bit strange that it's blank. Did some testing and if I comment out a while loop that's nested in the if...handle bit it diplays OK. Can you see what it is from this or do you need more code/info? (There are some single comment lines in there too but you can see which 'while block' i mean. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); if (isset($_POST['submitted'])) { include ('./includes/config.php'); include ('./includes/opendb.php'); $ec = $_POST['ec']; //$query = "SELECT CONCAT(client_lname, ', ',client_fname) AS name FROM clients ASC WHERE client_lname='$ec'"; $query = "SELECT CONCAT(client_lname, ', ',client_fname) AS name FROM clients WHERE client_lname='$ec'"; $result = @mysql_query ($query); if ($result) { echo '<table style="width: 80%" cellpadding="5px" border="0"> <tr> <td align="left">Users Name</td> </tr>'; /*while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { //echo '<tr><td align="left">' . $row['name'] . '</td></tr>'; //$id = $row["name"]; echo "<tr><td align=\"left\"><a href=\"editSearcheduser.php?userid=$row\"> . $row['name'] . </a></td></tr>"; }*/ echo '</table>'; mysql_free_result ($result); //include ('./includes/addclientfooter.html'); //exit(); //echo 'Or select another surname below: -'; } else { echo '<p>Sorry, no users match your search.</p>'; } mysql_close(); } ?> Thank you all, Mark Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 6, 2007 Share Posted September 6, 2007 Remove the @ - it is the error supressor. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.