#1 (permalink)  
Old 10-05-2004, 02:34 PM
Hart_House's Avatar
Registered
 
Join Date: Aug 2001
Location: Toronto, Ontario
Posts: 679
Hart_House is on a distinguished road
Default Need some help with this query.

I have a query that I just can't seem to figure out.

I want to select links from the same category that link is in.

query = "select * from idx_link where category_id = (to same category that link is in) order by title";
  #2 (permalink)  
Old 10-05-2004, 04:05 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

Code:
Content visible to License Owner only.



__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
  #3 (permalink)  
Old 10-05-2004, 07:19 PM
Hart_House's Avatar
Registered
 
Join Date: Aug 2001
Location: Toronto, Ontario
Posts: 679
Hart_House is on a distinguished road
Default

Fatal error: Call to a member function on a non-object on:

$category_id = $result->Fields("category_id");

I'm basically trying to insert this query into the detail.php page.


Where am I going wrong?
  #4 (permalink)  
Old 10-05-2004, 08:02 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

try changing $link_id to $linkid



__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.

Last edited by esm; 10-05-2004 at 08:20 PM.
  #5 (permalink)  
Old 10-05-2004, 08:56 PM
Hart_House's Avatar
Registered
 
Join Date: Aug 2001
Location: Toronto, Ontario
Posts: 679
Hart_House is on a distinguished road
Default

its not the $linkid or $id which I have tried.

For some reason it get an error on that one important line

$category_id = $result->Fields("category_id"); which prevents me from isolating the category_id

why oh why...

When i put $category_id = 200; it works for category 200... but thats not what i want... boo
  #6 (permalink)  
Old 10-05-2004, 10:29 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

send me your detail.php file



__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
  #7 (permalink)  
Old 10-05-2004, 10:33 PM
Hart_House's Avatar
Registered
 
Join Date: Aug 2001
Location: Toronto, Ontario
Posts: 679
Hart_House is on a distinguished road
Default

OK. I fixed it.

$result1 = $conn->Execute($query);

$category_id = $result1->Fields("category_id");

All i had to do was place a 1 after the result...
  #8 (permalink)  
Old 10-05-2004, 10:34 PM
TLC TLC is offline
Registered User
 
Join Date: Jul 2003
Posts: 20
TLC
Default Shouldn't something be pass to $result first

Shouldn't something be pass to $result first before trying to extract something from it
  #9 (permalink)  
Old 10-05-2004, 11:10 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

here is the code to make it work:

Code:
Content visible to License Owner only.


__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Closed Thread

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
I got fatal Error when rating links..... Please Help liang99 v5.x 6 09-11-2003 09:00 AM
indexu 3.1 & mysql 3.22 Heiko v5.x 26 07-07-2003 05:30 PM
All fields in all templates ?? Frank71 v5.x 8 06-25-2003 09:27 PM
Query Box craven v5.x 5 04-28-2003 09:14 PM
kill all links? kwilder v5.x 5 07-16-2002 04:26 PM

HACKER SAFE certified sites prevent over 99.9% of hacker crime.

All times are GMT -5. The time now is 03:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO
SSL Certificate