ok here is continuation of the same proplem:
here is my code:
<?php
include("dbconnect.php");
?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SCOA New Assets</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="/listnav_button.css" />
</head>
<body bgcolor="#66CCCC">
<div id="Layer1">
<div id="navigation">
<ul>
<table width="100" border="0" cellpadding="3" cellspacing="3">
<tr>
<td><li><a href="#">Submit</a></li></td>
</tr>
<tr>
<td><li><a href="#">Update</a></li></td>
</tr>
<tr>
<td><li><a href="#">Delete</a></li></td>
</tr>
<tr>
<td><li><a href="#">Reports</a></li></td>
</tr>
<tr>
<td><li><a href="#">Exit</a></li></td>
</tr>
</table>
</ul>
</div>
</div>
<div id="Layer2">
<div align="center"><strong>
<br />St Cloud Orthopedics Asset Database </strong></div>
</div>
<div id="Layer3" align="center">
<form method="post" action="new.php">
Please select Table
<select name="table">
<option selected="selected">-----</option>
<option value="Fax">Fax</option>
<option value="Copiers">Copiers</option>
<option value="Dictaphone">Dictaphone Servers</option>
<option value="Scanners">Scanners</option>
<option value="UPS">UPS</option>
<option value="Server">Servers</option>
<option value="computers">Computers</option>
<option value="nHardware">nHardware</option>
<option value="nPrinter">nPrinter</option>
<option value="sPrinters">sPrinter</option>
<option value="Location">Location</option>
<option value="Description">Description</option>
</select>
<br /><br />
<input type="submit" name="submit" value="Submit" />
<?php
$table = $_POST['table'];
$field_names = array();
$res = mysql_query("SHOW COLUMNS FROM '$table'") or die("mysql error");
for($i=0;$i<mysql_num_rows($res);$i++){
array_push($field_names,mysql_result($res, $i));
}
?>
</form>
</div>
</body>
</html>
This supposed let the user select the table that a new item is to inserted to. I know it is no complete for insertion, but i am doing this piece by making sure it work.
i keep getting the mysql error.
'can you folks look to see what it is i have done wrong?