Hi,
I have a Zen Cart store that I have added some code that will display in the product description info page. My problem is that I can not tell if it is my PHP code or the Query.
I am new to PHP/MHSQL. I am more of a Coldfusion/SQL developer. Below is my code and a link to help explain.
I believe that the results are trying to display but just don't appear and I don't know where to look for errors. The folks over at the zen cart forum have been much help but I need some more.
Code:
<?php //it is recommended to always use the full <?php opening, not the shorthand <?
// Get all records in all columns from table and put it in $result.
$query="select Manual, Figure, Item, rev, link, Name from zen_product_manuals where itemnumber = '6630206' Order By Manual, Figure";
$result=mysql_query($query) or die(mysql_error());
?>
<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_array($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="<?php echo $row['link']; ?>"><?php echo $row['figure']; ?></a></td>
<td nowrap="nowrap"><?php echo $row['item']; ?>"</td>
<td nowrap="nowrap"><?php echo $row['name']; ?></td>
</tr>
<?php
} //end of while loop ?>
</tbody>
</table>
Link:
Any help is so appreciated!
Thanks
Sue
I have a Zen Cart store that I have added some code that will display in the product description info page. My problem is that I can not tell if it is my PHP code or the Query.
I am new to PHP/MHSQL. I am more of a Coldfusion/SQL developer. Below is my code and a link to help explain.
I believe that the results are trying to display but just don't appear and I don't know where to look for errors. The folks over at the zen cart forum have been much help but I need some more.
Code:
<?php //it is recommended to always use the full <?php opening, not the shorthand <?
// Get all records in all columns from table and put it in $result.
$query="select Manual, Figure, Item, rev, link, Name from zen_product_manuals where itemnumber = '6630206' Order By Manual, Figure";
$result=mysql_query($query) or die(mysql_error());
?>
<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_array($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="<?php echo $row['link']; ?>"><?php echo $row['figure']; ?></a></td>
<td nowrap="nowrap"><?php echo $row['item']; ?>"</td>
<td nowrap="nowrap"><?php echo $row['name']; ?></td>
</tr>
<?php
} //end of while loop ?>
</tbody>
</table>
Link:
Any help is so appreciated!
Thanks
Sue