Not a MySQL expert, so I won't try to advise on the query, but I do have a few comments on the file you posted.
Get rid of items in red.
<?
// Connect database
include("connectdb.php");
//You shouldn't need to specifically connect to the db
// Get all records in all columns from table and put it in $result.
//use the zen db functions which are specifically built to handle the queries in ZC.
$result=mysql_query("select Manual, Figure, Item, rev, link, Name from zen_products_manuals where itemnumber = v_products_model Order By Manual, Figure");
/*Split records in $result by table rows and put them in $row.
Make it looping by while statement. */
while($row=
=mysql_fetch_assoc($result)){ //== is the test; = is assignment
</head>
<body>
<table border="0">
<tbody>
<tr> //use <th> for the heading row
<t
h nowrap="nowrap">
<font size="1">Manual
</font></t
h> //you don't need to put font tags everywhere - this is officially deprecated. Use the stylesheet to set sizes, fonts etc.
<td nowrap="nowrap"><font size="1">Figure</font></td>
<td nowrap="nowrap"><font size="1">Item</font></td>
<td nowrap="nowrap"><font size="1">Rev</font></td>
<td nowrap="nowrap"><font size="1">Name</font></td>
</tr>
<cfoutput query="Getmanual"> //this is not going to do anything in PHP
<tr>
<td nowrap="nowrap">
<font size="1"><?php echo $row['manual']; ?>"
</font></td>
<td nowrap="nowrap"><?php echo $row['figure']; ?>"<a href="
#getmanual.link#"><font size="1">#getmanual.figure#</font></a></td>
<td nowrap="nowrap"><?php echo $row['item']; ?>"<a href="#getmanual.link#"><font size="1">#getmanual.item#</font></a></td>
<td nowrap="nowrap"><font size="1"><?php echo $row['name']; ?>"</font></td>
</tr>
</cfoutput>
</tbody>
</table>
</body>
</html>
There are too many different things here to show comprehensibly in one file listing.
Getting rid of the bad HTML tags and PHP include first (also moving <table> tags outside of loop):```php
<?php //it is recommended to always use the full <?php opening, not the shorthand <?
// Connect database
//include("connectdb.php");
// Get all records in all columns from table and put it in $result.
$result=mysql_query("select Manual, Figure, Item, rev, link, Name from zen_products_manuals where itemnumber = v_products_model Order By Manual, Figure");
/*Split records in $result by table rows and put them in $row.
Make it looping by while statement. */
// close PHP before outputting HTML, or else use PHP echo statement
// echo '<table border="0"><tbody>';
?>
<table border="0">
<tbody>
<tr>
<th nowrap="nowrap">Manual</th>
<th nowrap="nowrap">Figure</th>
<th nowrap="nowrap">Item</th>
<th nowrap="nowrap">Rev</th>
<th nowrap="nowrap">Name</th>
</tr>
<?php
while($row=mysql_fetch_assoc($result)){ //while may not be best kind of loop - foreach is made for stepping through arrays
?>
<tr>
<td nowrap="nowrap"><?php echo $row['manual']; ?></td> <!-- these #getmanual.link# will need to be replaced with PHP statements -->
<td nowrap="nowrap"><?php echo $row['figure']; ?>"<a href="#getmanual.link#">#getmanual.figure#</a></td>
<td nowrap="nowrap"><?php echo $row['item']; ?>"<a href="#getmanual.link#">#getmanual.item#</a></td>
<td nowrap="nowrap"><?php echo $row['name']; ?></td>
</tr>
<?php
} //end of while loop ?>
</tbody>
</table>
```