PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old September 11th, 2002, 06:23 PM
tgfiles tgfiles is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 tgfiles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 11th, 2002, 07:21 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Need help printing names in right order

How are you determining what the current category is?


Reply With Quote
  #3  
Old September 11th, 2002, 07:58 PM
tgfiles tgfiles is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 tgfiles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old September 13th, 2002, 03:44 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Need help printing names in right order

change

$ccat=$row["cat"];

to

$ccat.=$row["cat"];

(just add dot "." in front of "=")...

Reply With Quote
  #5  
Old September 15th, 2002, 06:08 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Need help printing names in right order

What does that dot do for it?

Reply With Quote
  #6  
Old September 15th, 2002, 07:51 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Need help printing names in right order

BUMP!!

I really wanna know wut that dot does!

Reply With Quote
  #7  
Old September 16th, 2002, 12:29 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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

Reply With Quote
  #8  
Old September 16th, 2002, 08:13 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Need help printing names in right order

thx.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Need help printing names in right order


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway