PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Donovan
Client


Joined: Oct 07, 2003
Posts: 691
Location: Ohio

PostPosted: Sun Sep 23, 2007 9:29 pm Reply with quote Back to top

This displays all comments or questions from a student population.

The reply from a course director ($rid) need to be displayed just underneath its corrosponding question ($cid).

Comment table
$cid

Reply table
$rid
$cid

Each record in the reply table will have a matching cid from the comment table.

I have to figure out the proper loop and why I was getting all 4 replies for a single comment.
Only registered users can see links on this board!
Get registered or login to the forums!



I also have another way of doing this by using another function and passing the $cid.

Only registered users can see links on this board!
Get registered or login to the forums!


Not quite working as planned but I'm almost ready to demo this.

Just need to figure out why I was getting all my replies displaying under one comment.
View user's profile Send private message Visit poster's website ICQ Number
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7485
Location: Arizona

PostPosted: Mon Sep 24, 2007 6:06 am Reply with quote Back to top

Donovan, it appears that you have a one-to-many relationship between these two tables, so, how were you wanting to restrict the comments to just one? What would be your functional requirement for this restriction (i.e., in words)?
View user's profile Send private message Visit poster's website
Donovan
Client


Joined: Oct 07, 2003
Posts: 691
Location: Ohio

PostPosted: Mon Sep 24, 2007 6:26 am Reply with quote Back to top

Well every rid has a corrosponding cid taken when the reply is sent. The cid is inserted into the reply table to link the two.

I thought a simple

Code:
SELECT * FROM reply r JOIN comments c WHERE c.cid= r.cid
would do the trick.
View user's profile Send private message Visit poster's website ICQ Number
Donovan
Client


Joined: Oct 07, 2003
Posts: 691
Location: Ohio

PostPosted: Mon Sep 24, 2007 8:52 am Reply with quote Back to top

I just made this all one query and it seems to work.
View user's profile Send private message Visit poster's website ICQ Number
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7485
Location: Arizona

PostPosted: Tue Sep 25, 2007 6:10 am Reply with quote Back to top

Cool...
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum