PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Tue Sep 25, 2007 8:36 pm
Never Mind
Not getting any help here
Last edited by
DRandy on Mon Nov 26, 2007 10:54 pm, edited 1 time in total.
__Cody__
Forum Newbie
Posts: 9 Joined: Sat Sep 08, 2007 7:01 am
Post
by __Cody__ » Wed Sep 26, 2007 3:28 am
Not sure why you would want to show one users URL in another users post, how are they linked? or is it a random users URL? or is a user selecting what URL they want in their post?
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Wed Sep 26, 2007 7:28 am
I'm not sure how you could have gotten as far as you have, and then suddenly become unable to accomplish this task. Perhaps more detail is needed?
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Wed Sep 26, 2007 12:43 pm
I'll try another forum
Last edited by
DRandy on Mon Nov 26, 2007 10:54 pm, edited 1 time in total.
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Wed Sep 26, 2007 5:39 pm
Something like this?
Code: Select all
SELECT
a.*,
b.user_url
FROM
posts as a,
posts as b
WHERE
a.id = 'id of post1' AND
a.newpostid = b.id
That query is ugly & uses what's called a JOIN in the WHERE clause
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Wed Sep 26, 2007 6:02 pm
Hey Thanks
I'll look that over and see what I can do.
I'll come back tomorrow.
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Thu Sep 27, 2007 5:20 pm
I'm leaving
Last edited by
DRandy on Mon Nov 26, 2007 10:57 pm, edited 1 time in total.
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Thu Sep 27, 2007 5:23 pm
How didn't it work?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Thu Sep 27, 2007 5:29 pm
I got a error message displaying on my page:
Fatal error: Call to a member function get_results() on a non-object in ...(my file where I put the code)
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Thu Sep 27, 2007 5:40 pm
So that means the get_results() function can't be called because $db isn't an object in that function. Is $db declared globally? How do you get $db into your get_the_url() function?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Thu Sep 27, 2007 5:52 pm
I'll work on it a while and hope to be back in a couple hours.
Thanks
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Thu Sep 27, 2007 8:55 pm
I'll go somewhere else
Last edited by
DRandy on Mon Nov 26, 2007 10:55 pm, edited 1 time in total.
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Fri Sep 28, 2007 9:49 am
You'll need to call get_th_referringauthor_postid() from within your get_the_url() function.
Declaring globals all over the place is generally considered bad form. You might want to consider encapsulating your functionality in a class.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
DRandy
Forum Newbie
Posts: 10 Joined: Sun Aug 26, 2007 12:43 pm
Post
by DRandy » Wed Oct 03, 2007 9:34 pm
Just not working here