TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 05-14-2008, 02:12 AM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default while loops and the proper code

GAH! it drives me insane, i'm going to blow my fucking open with a fucking gun.

anyway, whats the proper code to stop while loops from giving me duplicates of fucking bullshit.

heres my problem, i have a custom forum, where the posts go by the fid for counting them, well, whenever I even try to add the fucking posts table, it duplicates my fucking forums, now I understand that its just grabbing the posts too so, whats the proper code for this? -_-
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-14-2008, 02:16 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

also, why do I have duplicate threads? no i ment on this forum, its like the problems find themselves back into my place. -_- fucked up. im really mad :D
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-14-2008, 02:24 AM   #3 (permalink)
The Gregarious
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 566
Thanks: 15
Village Idiot is on a distinguished road
Default

Disclaimer: If language offends you, walk away now.

First off, I have never seen a way that PHP can produce "fucking bullshit", I didn't even know bullshit could fuck. I also find it ironic that instead of ID you use Fid, hmmmm.

I am not fucking sure about your fucking question, I would have to see the fucking code before I could make a fucking decision.
__________________
There are two ways to write bug-free code, only the third one works.
Village Idiot is offline  
Reply With Quote
Old 05-14-2008, 03:04 AM   #4 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
Disclaimer: If language offends you, walk away now.

First off, I have never seen a way that PHP can produce "fucking bullshit", I didn't even know bullshit could fuck. I also find it ironic that instead of ID you use Fid, hmmmm.

I am not fucking sure about your fucking question, I would have to see the fucking code before I could make a fucking decision.
lol, i even missed a few words, cause language is soooo hard. xD anyway, fid is the forum id, and i have the post table have 'forumid' for it to direct the forum ids to fid but, it just repeats the same forum names over... yeah..

by the way, heres your fucking code, fucking fucking fuck :P

Code:
SELECT forums.fid,forums.name,forums.desc,posts.pid,posts.forumid
FROM forums,posts
Group By forums.fid
I classify it as noobish code, cause I'm not trying to make anything professional. :P
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-14-2008, 03:18 AM   #5 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

it makes me sad that iv'e been able to accomplish this type of stuff before, but now, i cant. LOL
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-14-2008, 03:21 AM   #6 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

by the way, i tried to do WHERE posts.forumid='forums.fid' and it gave me nothing, this is basically saying that the forumid is 1 and the fid is 1, so it would say 1='1', so this is stupid. -_-
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-14-2008, 03:44 AM   #7 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

wow i finally got it and it was easy.. i cant think D:
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-14-2008, 07:51 PM   #8 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
wGEric is on a distinguished road
Default

sql Code:
SELECT forums.fid,forums.name,forums.DESC,posts.pid,posts.forumid
FROM forums,posts
WHERE posts.forumid = forums.fid

When you put single quotes around it it was looking for where the column's value is that string and not where the two columns equal.

Also you should avoid using keywords for column names (change desc to something else).
__________________
Eric
BlogphpBB
wGEric is offline  
Reply With Quote
The Following User Says Thank You to wGEric For This Useful Post:
Orc (05-14-2008)
Old 05-14-2008, 08:30 PM   #9 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

This is just a test
Quote:
Originally Posted by ttt
Quote:
Originally Posted by ttt
test
test
ytest
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 05-16-2008, 09:10 AM   #10 (permalink)
The Contributor
 
EyeDentify's Avatar
 
Join Date: Nov 2007
Location: Sweden
Posts: 91
Thanks: 11
EyeDentify is on a distinguished road
Default

@Orc.

Please try to be an mature adult and use proper language in this forum. There is no reason for dragging your profanity's in here. I can understand that your upset but you only show a lack of communication skills when using cursing instead of the proper words.

I come to these forums to read interesting discussions on the PHP subject not some peoples ongoing rants filled with cursing words. So option them out of your next post.

Other then that, good luck! :)
__________________
Of course the whole point of a doomsday machine, would have been lost if you keep it a secret.
EyeDentify is offline  
Reply With Quote
Old 05-16-2008, 03:24 PM   #11 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 818
Thanks: 163
Orc is on a distinguished road
Default

Quote:
Originally Posted by EyeDentify View Post
@Orc.

Please try to be an mature adult and use proper language in this forum. There is no reason for dragging your profanity's in here. I can understand that your upset but you only show a lack of communication skills when using cursing instead of the proper words.

I come to these forums to read interesting discussions on the PHP subject not some peoples ongoing rants filled with cursing words. So option them out of your next post.

Other then that, good luck! :)
And yet, you didn't support the thread, didn't give me a good solution to my problem. :P
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:53 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0