Código HTML:
Ver original
<?php $a=''; ?> <html> <head> </head> <body bgcolor="#00CCFF"> <table width="80%" border="0" align="center" cellpadding="0" bgcolor="#FFFFFF"> <tr bgcolor=""> </td> </td> </tr> <tr bgcolor=""> </tr> <tr> </tr> <tr> <td width="196" valign="top" height="370"> <table border="0" cellspacing="0" cellpadding="0" width="155" id="navigation"> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <table border="0" cellspacing="0" cellpadding="0" width="675" > <tr> </tr> <td align="center"> <form name="form1" method="post" action=""> VER <select name="menu1" href"http://localhost/Biblioteca/invent_user.php"> </select> <label>BUSCAR <input name="textarea" type="text" value=""> </label> <label> <input type="submit" name="Submit" value="ACTUALIZAR LISTA" onClick=scr""> </label> <select name="menu2" > </select> <tr> <?php $db_host = 'localhost'; $db_user = 'root'; $database = 'hidrobib'; $table = $_POST; if (!mysql_connect($db_host, $db_user)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); if ($a=="") $a=0; $b=$a + 30; // sending query $result = mysql_query("SELECT * FROM $table ORDER BY $table.Numero LIMIT $a,$b "); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); echo "<table border='3' width=100% ><tr>"; // printing table headers for($i=0; $i<$fields_num; $i++) { if ($i==0){ $field = mysql_fetch_field($result); echo "<td width=10%>{$field->name}</td>"; } else{ $field = mysql_fetch_field($result); } } echo "</tr>\n"; // printing table rows while($row = mysql_fetch_row($result)) { echo "<tr>"; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "</tr>\n"; } mysql_free_result($result); ?> </tr> </table> <tr> </tr> </table> </body> </html>