Here's what I have...I realize it's 'the old way', but it gets done what I need:
Code
<?
// Connect to the database
mysql_connect ('localhost', 'myname', 'mypassword') ;
mysql_select_db ('mydatabase');
// Number of items displayed
$num_displayed = 1 ;
// Select random items from the database
$result = mysql_query ("SELECT * FROM _pncommerce_items ORDER BY RAND() LIMIT $num_displayed");
// For all the rows that you selected
while ($row = mysql_fetch_array($result))
{
// Display them to the screen...
echo "<a href=\"../module-pncommerce-itemview-ItemID-" . $row["ItemID"] . ".phtml\"><img src=\"../modules/pncommerce/product_images/" . $row["ItemSKU"] . "tn.jpg\" border=0 alt=\"" . $row["ItemName"] . "\"></a>";
echo "<a href=\"../module-pncommerce-itemview-ItemID-" . $row["ItemID"] . ".phtml\">" . $row["ItemName"] . "</a>";
echo "<div align=\"left\">";
echo "<form action=\"../index.php?module=pncommerce&func=itemedit\" method=\"post\">";
echo "<input type='hidden' name='authid' value=''><font class='pn-normal'>Add</font>";
echo "<input type='text' name='ItemQuantity' value='1' size='2'>";
echo "<input type='hidden' name='ItemID' value=\"" . $row["ItemID"] . "\">";
echo "<input type='hidden' name='Mode' value='add'>";
echo "<input class='pn-button' TYPE='submit' VALUE='Add to my Cart'>";
echo "<input type='hidden' name='cartview' value='on' >";
echo "</form>";
echo "</div>";
}
?>
// Connect to the database
mysql_connect ('localhost', 'myname', 'mypassword') ;
mysql_select_db ('mydatabase');
// Number of items displayed
$num_displayed = 1 ;
// Select random items from the database
$result = mysql_query ("SELECT * FROM _pncommerce_items ORDER BY RAND() LIMIT $num_displayed");
// For all the rows that you selected
while ($row = mysql_fetch_array($result))
{
// Display them to the screen...
echo "<a href=\"../module-pncommerce-itemview-ItemID-" . $row["ItemID"] . ".phtml\"><img src=\"../modules/pncommerce/product_images/" . $row["ItemSKU"] . "tn.jpg\" border=0 alt=\"" . $row["ItemName"] . "\"></a>";
echo "<a href=\"../module-pncommerce-itemview-ItemID-" . $row["ItemID"] . ".phtml\">" . $row["ItemName"] . "</a>";
echo "<div align=\"left\">";
echo "<form action=\"../index.php?module=pncommerce&func=itemedit\" method=\"post\">";
echo "<input type='hidden' name='authid' value=''><font class='pn-normal'>Add</font>";
echo "<input type='text' name='ItemQuantity' value='1' size='2'>";
echo "<input type='hidden' name='ItemID' value=\"" . $row["ItemID"] . "\">";
echo "<input type='hidden' name='Mode' value='add'>";
echo "<input class='pn-button' TYPE='submit' VALUE='Add to my Cart'>";
echo "<input type='hidden' name='cartview' value='on' >";
echo "</form>";
echo "</div>";
}
?>
edited by: quasiman, Apr 04, 2007 - 04:40 PM
--
born ok the first time
