Webmastersite.net
Register Log In

search field errors, customizing search

Comments on search field errors, customizing search

knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004

Total Topics: 20
Total Comments: 83
Posted May 02, 2005 - 7:35 AM:

Well, the gallery is up and running, thanks for the encoder help!

My problem now is with searches. I enabled all search fields in the admin panel and, I can search by title and description but, most other searches (such as xwidth) are returning errors of:

Performing query: SELECT id FROM members_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND alias=0 AND inalbum=0) AND (()) ;

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ~my path~/classes/database.php on line 82
Number of rows is for You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1

It is not passing the field name to the query for some reason. My ultimate goal is to create several custom searches on fields that are unique to my database. To that end, I edited the Advanced Search template from:
<input type="text" size="{STANDARDSIZE}" name="namesearch">
to
<input type="text" size="{STANDARDSIZE}" name="user_namesearch">
which is my field name.

This seemed like it almost worked, instead of the:
'syntax to use near '))' at line 1' error I now get"
'Performing query: SELECT id FROM users WHERE (validated=1) AND ((user_name 'es')) ;'

It seems the < > like etc., are not being included in these queries.

So, I guess I have two problems. The first being that fields such as xwidth are not being passed to the query and the second being that the comparison operators are not being passed.

Am I doing/not doing something that I should be?
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004

Total Topics: 20
Total Comments: 83
Posted May 02, 2005 - 8:02 AM:

oK, still fooling around with the search and, I've figured out that on the members search the problem is with
SELECT id FROM

I am using a custom integration so, it sould be:
SELECT user_id FROM

Trying to find where I can change this...
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004

Total Topics: 20
Total Comments: 83
Posted May 02, 2005 - 9:21 AM:

Well, now I think I've figured out what's going on. The gallery integration did not assign the custom field names in the search functions. I went back into my integration script and removed the field assignments, and then changed mysql fields to:

user_id > id
user_name > name

And the search is working.

This is comforting but, I need the search to work properly using my custom field names. All my existing sign-up, login, and other member scripts rely on these values.

I've been digging around database.php and search.php all morning but, I can't find the sql for these queries. Can someone help point me in the right direction?

Thanks!
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted May 04, 2005 - 11:48 AM:

How would member integration relate to image searches? You're not talking about member searches?

Well, I'll see if I can find something integrated to check on.
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004

Total Topics: 20
Total Comments: 83
Posted May 05, 2005 - 7:16 AM:

Well, I was talking about both. Image searches based on the 'description' worked fine (sql looked normal). Image searches based on xwidth, filesize, etc had the bad syntax and would not work.

The member search is where the real problem is for me (I'll never have anyone searching xwidth or, images in general). It seemed that the search wanted a field named 'id' even though I had changed that field in my integration script to 'user_id.' I changed the field name in my testing database to 'id' and, everything seemed to work oK (I also had to change the 'user_name' field to 'name' even though I had specified $newname = $user_name in my integration, as well).

Again, all this was after I had everything up and running and had uploaded several images into several profiles.

Hope that helps/makes sense.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted May 06, 2005 - 9:06 PM:

My only integrated galleries are integrated with a script with the same field names, so I can't really test that. I guess I'll have to find some other script somewhere to install, since nothing appears wrong in the file.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.