Reply
Pinnacle Cart Programming Needed Urgently!
Old 05-20-2005, 06:36 PM Pinnacle Cart Programming Needed Urgently!
Brian07002's Avatar
Webmaster Talker

Posts: 526
Name: Brian
Location: United States
I forgot to mention that the . $row["title"] in the code below displays the "Alt text for each product" that was easy cause it was a row in the table.

Back to the message....


I need someone to help me out with the pinnacle cart regarding the (Smarty Template System)...

All I want to do is add this php code into one of the html files:

Code:
// PHP script
<?
// Connect to the database
mysql_connect ('localhost', 'username', 'pass') ;
mysql_select_db ('dbase'); 

// Edit this number to however many links you want displaying
$num_displayed = 1 ;

// Select random rows from the database
$result = mysql_query ("SELECT * FROM products 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=\"" . $row["link"] . "\">
<img src=\"" . $row["image_url"] . "\" border=1 alt=\"" . $row["title"] . "\">
</a>" ;
}
?>
I just can't figure out 2 stinking things for the life of me! If you look at the // Display them to the screen Section, (right above), I am trying to get the product attributes such as the link that goes with that particular image associated with .$row["image_url"] to display...Please note that the .$row["link"] is incorrect only because the database doesn't contain a row called "link"...My problem is figuring out what goes there...From my shopping cart templates I have something in the lines of:

Code:
<a href="{$index_url}">Go to home page</a>
I just can't figure out the way to make it change according to the .$row["image_url"] which is the random image being displayed.

If you know this "Smarty" "CRAPOLA" leave a tip or two, or three...Or whatever.

Thanks alot!

-Brian
__________________
Brian
TMS BBS: 201-471-2205
Open Friday thru Sunday Eastern Time (US & Canada)

Last edited by Brian07002 : 05-20-2005 at 06:38 PM.
Brian07002 is online now
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Reply     « Reply to Pinnacle Cart Programming Needed Urgently!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12971 seconds with 12 queries