How to Exclude Some Result From a Particular Row of Table from Showing
I am using mysql_fetch_array to fetch result from a table of my database and I want to exclude results from particular users from being fetch together with others.
Example:
$result = mysql_query("SELECT * FROM users")
or die(mysql_error());
echo "<table border='1' cellpadding='10'>";
echo "<tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th>Sex</th> <th>Username</th></tr>";
while($row = mysql_fetch_array( $result )) {
// echo out the contents of each row into a table
echo "<tr>";
echo '<td>' . $row['id'] . '</td>';
echo '<td>' . $row['firstname'] . '</td>';
echo '<td>' . $row['lastname'] . '</td>';
echo '<td>' . $row['sex'] . '</td>';
echo '<td>' . $row['username'] . '</td>';
echo "</tr>";
}
echo "</table>";
Example Results
ID First Name Last Name Sex Username
1 Adams John Male adamsjo
2 Jen Jensen Female jensenjen
3 Mark Mike Male miker
4 Mathew Denson Male denis
etc
How can i exclude results from the first two rows of ID 1 and 2 from showing together with the rest of the result?
2
Contributors
3
Replies
30 Minutes
Discussion Span
1 Year Ago
Last Updated
4
Views
Question Answered
Related Article:Pass the value of particular row to text box for edit
is a PHP discussion thread by passioncoder that has 2 replies, was last updated 9 months ago and has been tagged with the keywords: pass, value, table, to, same, page.