|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Need help printing names in right order
I need help printing my shopping cart categories on the cart product pages
At the top of the page I have Category: Main >> After >> I want the current Category to be printed. I got it working but it only prints the last category I added to the database table in mysql. I tried everything and know this is a simple thing to do I just can't get it to work. Any Help would be greatly appreciated Thanks Brian |
|
#2
|
|||
|
|||
|
RE: Need help printing names in right order
How are you determining what the current category is?
|
|
#3
|
|||
|
|||
|
RE: Need help printing names in right order
Right now I'm using this function
========================== <?php $result = mysql_query( "SELECT * FROM Calloways_cartcat ORDER by cat"); if (!$result) { echo("<P>There was an error performing query: " . mysql_error() . "</P>"); exit(); } while ( $row = mysql_fetch_array($result) ) { $ccat=$row["cat"]; } Echo "$ccat"; ?> It will print the category but only from the last category I added to the database table Calloways_cartcat and not the current one that's displayed on the page. That's about all I have I hope this explains my problem a little better. Thanks Brian |
|
#4
|
|||
|
|||
|
RE: Need help printing names in right order
change
$ccat=$row["cat"]; to $ccat.=$row["cat"]; (just add dot "." in front of "=")... |
|
#5
|
|||
|
|||
|
RE: Need help printing names in right order
What does that dot do for it?
|
|
#6
|
|||
|
|||
|
RE: Need help printing names in right order
BUMP!!
I really wanna know wut that dot does! |
|
#7
|
|||
|
|||
|
RE: Need help printing names in right order
when u write $a+=$b that actualy means $a=$a+$b
similary, $c.=$d means $c=$c.$d and $c.$d is string contatenation, so if $c="abc" and $d="123", when u do a $c.=$d now $c is "abc123" look at php man |
|
#8
|
|||
|
|||
|
RE: Need help printing names in right order
thx.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Need help printing names in right order |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|