Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Pinnacle Cart Programming Needed Urgently!
Old 05-20-2005, 07:36 PM Pinnacle Cart Programming Needed Urgently!
Brian07002's Avatar
Defies a Status

Posts: 2,142
Name: ...
Location: ...
Trades: 0
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
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 05-20-2005 at 07:38 PM..
Brian07002 is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Pinnacle Cart Programming Needed Urgently!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.59473 seconds with 12 queries