|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Help adding links to Multicolumns
Hi there! I'm currently building a shopping cart from very little I know about php and mysql.
I used the multi-column script from this site for the front page. It worked out great! I need help adding links to the product categories. It looks something like this.... $columns = 2; $query = "SELECT * FROM Calloways_cartcat ORDER BY cat"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); $rows = ceil($num_rows / $columns); while($row = mysql_fetch_array($result)) { $data[] = $row['image']; $data2[] = $row['cat']; $data3[] = $row['catdes']; } echo "<center><TABLE BGCOLOR="#FFFFFF" cellpadding="0" cellspacing="0" BORDER="0">n"; for($i = 0; $i < $rows; $i++) { echo "<TR>n"; for($j = 0; $j < $columns; $j++) { if(isset($data[$i + ($j * $rows)])) { $cid=$row["cid"]; echo "$cid"; echo "<TD><img src="" . $data[$i + ($j * $rows)] . ""></TD>n"; echo "<TD><a href="modules.php??op=modload&name=Calloways_Cart&&service="$cid">" . $data2[$i + ($j * $rows)] . "</a><br>n"; echo "" . $data3[$i + ($j * $rows)] . "</TD>n"; } } } echo "</TR>n"; echo "</TABLE></center><br><br>n"; I need to call cid (category ID) from my shopping cart category table in mysql and make it so the when you click on the category it takes you to the product page. I all ready have the product pages done! Please help I'm lost at this point. Thanks Brian |
|
#3
|
|||
|
|||
|
RE: Need Help adding links to Multicolumns
Thanks It got it working!
It's always the easy stuff that gets me! Brian |
|
#4
|
|||
|
|||
|
RE: Need Help adding links to Multicolumns
No worries
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Need Help adding links to Multicolumns |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|