Welcome Guest, Not a member yet? Register   Sign In
Building a "favorite this" system and totally stuck
#5

[eluser]gullah[/eluser]
ok so you are going to be doing a foreach loop to print out the blogs more than likely

This is how I would do it and I don't think it would be a problem with resources unless the users are voting on many many blogs.

or you could work on your query to see if you can single it down more.

so...
foreach(blogs as blog)
{
foreach(votes as vote)
{
$voted = 0;
if(vote->blog_id == blog->id)
{
$voted = 1;
}
}
$if($voted == 0)
{
display vote link
}
display blog
}


Messages In This Thread
Building a "favorite this" system and totally stuck - by El Forum - 07-22-2008, 06:43 AM
Building a "favorite this" system and totally stuck - by El Forum - 07-22-2008, 08:26 AM
Building a "favorite this" system and totally stuck - by El Forum - 07-22-2008, 09:01 AM
Building a "favorite this" system and totally stuck - by El Forum - 07-22-2008, 10:09 AM
Building a "favorite this" system and totally stuck - by El Forum - 07-22-2008, 11:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB