PHP path:
Use continue in a while loop when these fields are retrieved, for example:
echo "<form action='".$_SERVER['PHP_SELF']."' method='get'>"; connectDB(); $result = mysql_query("SHOW COLUMNS FROM mash") or die(mysql_error()); echo '<select name="column" class="column">'; while ($row = mysql_fetch_array($result)) { if($row[0] == 'id' || $row[0] == 'tstamp') continue; echo "<option value='".$row[0]."'>".ucwords($row[0])."</option>"; } closeConn(); echo '</select>'; echo "</form>";
This will simply skip the id and tstamp and process the rest. continue used in loop structures to skip the rest of the current iteration of the loop and continue execution when evaluating the state, and then at the beginning of the next iteration.
MySQL path:
Delete these fields in the query as follows:
SHOW COLUMNS FROM mash WHERE Field NOT IN ('id', 'tstamp');
shamittomar
source share