Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Unlimited categories & subcategories help...
Old 04-04-2011, 04:14 AM Unlimited categories & subcategories help...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I am trying to get the script on this site to work:
http://www.knowledgesutra.com/forums...ub-categories/

The error has been:
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /index.php on line 15
This is pointing to the while loop, in both the files, index.php and sub.php. I can't for the life of me figure it out. If you have the mind to make me get it, please do...

Thank you!
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-04-2011, 04:23 AM Re: Unlimited categories & subcategories help...
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Looks like a syntax error in the query:
PHP Code:
$query "SELECT * FROM 'categories' WHERE 'parentid' = 0 ORDER BY 'catid' ASC"
Table names shouldn't be quoted. They can be surrounded with backticks (`), but don't need to be unless the table name is a keyword. The same goes for column names.

Try
PHP Code:
$query "SELECT * FROM categories WHERE parentid = 0 ORDER BY catid ASC"
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 04-04-2011, 04:32 AM Re: Unlimited categories & subcategories help...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Sorry nul, I've tried that before, and still no go. I still get the same error.

I don't get it...
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 04-04-2011 at 04:41 AM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 04-04-2011, 04:55 AM Re: Unlimited categories & subcategories help...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
anyone else have a suggestion?
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 04-04-2011, 07:24 AM Re: Unlimited categories & subcategories help...
Super Spam Talker

Posts: 880
Name: Paul W
Trades: 0
1) Have you successfully created the tables and added the records?

2) Do you check the outcome of your connection to the db?

3) Do you check the outcome of the query?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 04-04-2011, 03:49 PM Re: Unlimited categories & subcategories help...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by PaulW View Post

1) Have you successfully created the tables and added the records?

2) Do you check the outcome of your connection to the db?

3) Do you check the outcome of the query?
1, Yes, according to the page...I will try it again and see
2. No, Haven't tried the outcome of the db, but it's making the obvious connection, so I don't think that is an issue
3. No, I will also try that and post back.

I just got in from work, so bare with me...I will check those two things and post the results back here.

Thanks!
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2011, 07:28 AM Re: Unlimited categories & subcategories help...
Junior Talker

Posts: 3
Trades: 0
Please check database connection string. Mainly the host, username and password string for connection.

Regards
__________________
Girish Mathur

Please login or register to view this content. Registration is FREE
, India

Please login or register to view this content. Registration is FREE
sritechnocrat is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Unlimited categories & subcategories help...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.11122 seconds with 12 queries