logo
WSN Links PHP Directory Software
Features Showcase Reviews Demos Purchase Manual Support
 

Between search type error
if minimum is actually set

Version: 4.1.11


Between search type error
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 72
Total Posts: 220
Posted 11/04/07 - 05:04 PM:
quote post
#1
Hi Paul,


I have a BETWEEN type search in my advanced search page. Looks like this:

<form action="http://www.webmastersite.net/forums/search.php?action=filter&filled=1&whichtype=links" method="post">

<select name="titlecondition">
<option value="like">contains</option>
</select>

<input type="text" size="{STANDARDSIZE}" name="titlesearch" />

<input type="hidden" name="eletkorconditon" value="between">
<input type="text" name="eletkorsearch" size="2" value="0"> and <input type="text" name="eletkorsearchmax" size="2">

<input type="submit" value="Keresés" class="button" />
</form>


When I leave the minimum value blank and enter a max value, I get a result fine.
When I leave the maximum value blank and enter a min value, I get a result fine.

When I enter a value for both, I get this:

Load time so far: 0.08 seconds.



Query 2: SELECT `name`,`value` FROM wsnlinks_switches WHERE id>0

Number of rows is 87

Load time so far: 0.09 seconds.



Query 3: SELECT `id`,`title`,`caneditown`,`caneditall`,`canvote`,`isadmin`,` canpost`,`canemail`,`validatecats`,`validatecomments`,`valid atelinks`,`validateedits`,`cansubmitlinks`,`cansubmitcategor ies`,`cansubmitcomments`,`caneditownlinks`,`caneditowncatego ries`,`caneditowncomments`,`caneditownprofile`,`caneditallli nks`,`caneditallcategories`,`caneditallcomments`,`caneditall profiles`,`candownloadfiles`,`canupload`,`canviewip`,`limitl inks`,`canemailmembers`,`canusehtml`,`limitlinksdaily`,`cana lias`,`cancopy`,`candeleteown`,`candeleteall`,`candofulledit `,`candeletecategories`,`candeletecomments`,`candeleteowncat egories`,`candeleteowncomments`,`candeletemembers`,`candelet eownmembers`,`canaliascategories`,`canviewpages`,`caneditvot es`,`numaliases`,`canviewvotes`,`canhideownlinks`,`canhideow ncategories`,`canhideowncomments`,`canhidealllinks`,`canhide allcategories`,`canhideallcomments`,`canratecomments`,`bytes permem`,`canpm`,`canim`,`canharddelete`,`limitpms`,`limitpms daily`,`canviewdeleted`,`cansubmitpolls`,`candeletepolls`,`c andeleteownpolls`,`caneditpolls`,`caneditownpolls`,`attachpe rpost`,`attachperpm`,`canviewshouts`,`caneditshouts`,`canedi townshouts`,`candeleteshouts`,`candeleteownshouts`,`cansubmi tshouts`,`canpollvote`,`customtitle`,`canviewinvisible`,`nam estyle`,`canpmimportant`,`canviewmodlog`,`isleader`,`cansubm itquotes`,`validatequotes`,`candeletequotes`,`candeleteownqu otes`,`canreport`,`canusesearch`,`attachperlink`,`validateat tachments`,`caneditownquotes`,`caneditallquotes`,`canviewcha t`,`caneditownevents`,`caneditallevents`,`candeleteownevents `,`candeleteevents`,`cansubmitevents`,`validateevents`,`bulk pms`,`issupermod`,`numinv`,`allowugspec`,`validateemails`,`v alidatesponsorlinks`,`cansubmittags`,`candeletetags`,`cansub mitfeeds`,`validatefeeds`,`validatefeeditems`,`numaliasestot `,`shoutsperday`,`validatetrader`,`renewdays`,`renewtimes` FROM wsnlinks_membergroups WHERE id>0

Query 4: LOCK TABLES wsnlinks_email WRITE, wsnlinks_links WRITE, wsnlinks_categories WRITE, wsnlinks_members WRITE

Load time so far: 0.12 seconds.



Query 5: SELECT `id`,`to`,`subject`,`message`,`headers`,`replacement`,`mime` FROM wsnlinks_email WHERE timesent=0 ORDER BY id ASC LIMIT 0,10

Number of rows is 0

Query 6: UNLOCK TABLES

Query 7: INSERT INTO wsnlinks_searches(`value`,`memberid`,`catid`,`time`) VALUES('1 2','0','','1194224590')

Load time so far: 0.14 seconds.



Query 8: SELECT `id`,`title`,`url`,`description`,`rating`,`votes`,`validated `,`catid`,`sumofvotes`,`email`,`time`,`hits`,`numcomments`,` hide`,`ownerid`,`voterips`,`voterids`,`lastedit`,`type`,`not ify`,`suspect`,`pendingedit`,`funds`,`suspended`,`alias`,`ex pire`,`ip`,`inalbum`,`typeorder`,`recipurl`,`hitsin`,`recipw ith`,`hitsinips`,`hitsoutips`,`lastcomment`,`related`,`inhid den`,`viewers`,`threadviewers`,`hitsintemp`,`hitsouttemp`,`o rigtype`,`importance`,`parentids`,`timesdead`,`timesemailed` ,`threadclosed`,`threadposters`,`lastposterid`,`lastposterna me`,`ownername`,`deleted`,`deletionreason`,`movedto`,`delete dby`,`timevalidated`,`filefield`,`message`,`sticky`,`downloa ds`,`pollid`,`posticon`,`savedby`,`validatedemail`,`unpaid`, `recipverified`,`effectivetime`,`sugcatid`,`pagerank`,`wysih tml`,`movedid`,`unrevised`,`feedurl`,`feedcache`,`feedcachet ime`,`tags`,`xmlsource`,`ordercomments`,`lastpadupdate`,`pad file`,`lastmonthlycheck`,`invisibleto`,`profileurl`,`lastpro fileurl`,`timesrenewed`,`mellboseg`,`derekboseg`,`csipoboseg `,`cipo`,`suly`,`teljesnev`,`orszag`,`megye`,`telepules`,`ma gassag`,`konfekcio`,`gyakorlat`,`iranyitoszam`,`hajszin`,`sz emszin`,`tevekenyseg`,`oltozet`,`magamrol`,`megjelenes`,`ref erencia`,`nyelvtudas`,`tiltott`,`telefon`,`eletkor`,`szulina p` FROM wsnlinks_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND deleted=0 AND alias=0 AND inalbum=0) AND ((effectivetime < 1194224590) AND (eletkor '1 2')) ORDER BY hits DESC LIMIT 0,60

Load time so far: 0.14 seconds.


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 ''1 2')) ORDER BY hits DESC LIMIT 0,60' at line 1

Query 9: SELECT COUNT(id) FROM wsnlinks_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND deleted=0 AND alias=0 AND inalbum=0) AND ((effectivetime < 1194224590) AND (eletkor '1 2'))


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/apollo/public_html/databases/mysql.php on line 29
Count is

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/apollo/public_html/databases/mysql.php on line 26

Number of rows is 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 ''1 2'))' at line 1

Load time so far: 0.2 seconds.


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 ''1 2'))' at line 1

Query 10: SELECT COUNT(id) FROM wsnlinks_sessions WHERE memberid>0

Count is 1

Load time so far: 0.2 seconds.



Query 11: SELECT COUNT(id) FROM wsnlinks_sessions WHERE memberid=0 AND isrobot=0

Count is 1

Load time so far: 0.2 seconds.



Query 12: SELECT COUNT(id) FROM wsnlinks_sessions WHERE memberid=0 AND isrobot=1

Count is 0

Load time so far: 0.2 seconds.



Query 13: SELECT COUNT(id) FROM wsnlinks_sessions WHERE time > 1194223690

Count is 2

Load time so far: 0.2 seconds.



Query 14: SELECT `id`,`memberid`,`location`,`time`,`ip`,`browser`,`starttime` ,`catid`,`threadid`,`areaname`,`lastsearch`,`nopermission`,` inchat`,`name`,`isrobot`,`lastchat`,`groupnamestyle`,`accept ims`,`visibility`,`profileurl` FROM wsnlinks_sessions WHERE time > 1194223690 ORDER BY memberid desc,time desc LIMIT 0,300

Number of rows is 2

Load time so far: 0.3 seconds.



Query 15: SELECT `id`,`memberid`,`location`,`time`,`ip`,`browser`,`starttime` ,`catid`,`threadid`,`areaname`,`lastsearch`,`nopermission`,` inchat`,`name`,`isrobot`,`lastchat`,`groupnamestyle`,`accept ims`,`visibility`,`profileurl` FROM wsnlinks_sessions WHERE ip='78.92.0.55' AND memberid=0

Number of rows is 1

Load time so far: 0.3 seconds.



Query 16: UPDATE wsnlinks_sessions SET starttime='1194217700', time='1194224590', location='http://www.apollomodel.net/search.php?action=filter&&whichtype=links', catid='', threadid='', areaname='Search Results', nopermission='0', inchat='0', ip='78.92.0.55' WHERE id=49



Any thoughts?

Thanks
David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 11/06/07 - 12:12 PM:
quote post
#2
Changed the rating field like that: http://www.webmastersite.net/screenshots/4509.jpg
Result: http://www.webmastersite.net/screenshots/22624.jpg

HTML:

<br />{LANG_SEARCH_ANDTHERATING} is between <input type="hidden" name="ratingcondition" value="between" />
<input type="text" name="ratingsearch" size="5" /> and <input type="text" name="ratingsearchmax" size="5" />


Are you sure you're dealing with a numeric field?
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 72
Total Posts: 220
Posted 11/07/07 - 12:32 PM:
quote post
#3
Hi Paul,

Interesting. The between is working fine now, even though I didn't touch anything. Weird.

NEW problem. This is the same search form:


<form action="http://www.webmastersite.net/forums/search.php?action=filter&amp;filled=1&amp;whichtype=links" method="post">

<select name="titlecondition">
<option value="like">megtalálható benne</option>
<option value="=">pontosan</option>
<option value="or">bármelyik szó</option>
<option value="and">minden szó</option>
<option value="!=">nem egyezik meg</option>
<option value="bool">boolean</option>
</select>
<input type="text" size="{STANDARDSIZE}" name="titlesearch" />

<input type="hidden" name="eletkorconditon" value="between"> <input type="text" name="eletkorsearch" size="2"> és <input type="text" name="eletkorsearchmax" size="2"> között

<input type="hidden" name="tevekenysegconditon" value="or">
<input type="checkbox" name="tevekenysegsearch" value="Divatmodell"> Divatmodell
<input type="checkbox" name="tevekenysegsearch" value="Sminkmodell"> Sminkmodell
<input type="checkbox" name="tevekenysegsearch" value="Hajmodell"> Hajmodell
<input type="checkbox" name="tevekenysegsearch" value="Fotómodell"> Fotómodell

<input type="submit" value="Keresés" class="button" />
</form>


When I check off 'Divatmodell' for example, knowing that there is a link in the database that has at least that value in that field, it produces this:


Load time so far: 0.08 seconds.

Query 2: SELECT `name`,`value` FROM wsnlinks_switches WHERE id>0

Number of rows is 87

Load time so far: 0.09 seconds.

Query 3: SELECT `id`,`title`,`caneditown`,`caneditall`,`canvote`,`isadmin`,` canpost`,`canemail`,`validatecats`,`validatecomments`,`valid atelinks`,`validateedits`,`cansubmitlinks`,`cansubmitcategor ies`,`cansubmitcomments`,`caneditownlinks`,`caneditowncatego ries`,`caneditowncomments`,`caneditownprofile`,`caneditallli nks`,`caneditallcategories`,`caneditallcomments`,`caneditall profiles`,`candownloadfiles`,`canupload`,`canviewip`,`limitl inks`,`canemailmembers`,`canusehtml`,`limitlinksdaily`,`cana lias`,`cancopy`,`candeleteown`,`candeleteall`,`candofulledit `,`candeletecategories`,`candeletecomments`,`candeleteowncat egories`,`candeleteowncomments`,`candeletemembers`,`candelet eownmembers`,`canaliascategories`,`canviewpages`,`caneditvot es`,`numaliases`,`canviewvotes`,`canhideownlinks`,`canhideow ncategories`,`canhideowncomments`,`canhidealllinks`,`canhide allcategories`,`canhideallcomments`,`canratecomments`,`bytes permem`,`canpm`,`canim`,`canharddelete`,`limitpms`,`limitpms daily`,`canviewdeleted`,`cansubmitpolls`,`candeletepolls`,`c andeleteownpolls`,`caneditpolls`,`caneditownpolls`,`attachpe rpost`,`attachperpm`,`canviewshouts`,`caneditshouts`,`canedi townshouts`,`candeleteshouts`,`candeleteownshouts`,`cansubmi tshouts`,`canpollvote`,`customtitle`,`canviewinvisible`,`nam estyle`,`canpmimportant`,`canviewmodlog`,`isleader`,`cansubm itquotes`,`validatequotes`,`candeletequotes`,`candeleteownqu otes`,`canreport`,`canusesearch`,`attachperlink`,`validateat tachments`,`caneditownquotes`,`caneditallquotes`,`canviewcha t`,`caneditownevents`,`caneditallevents`,`candeleteownevents `,`candeleteevents`,`cansubmitevents`,`validateevents`,`bulk pms`,`issupermod`,`numinv`,`allowugspec`,`validateemails`,`v alidatesponsorlinks`,`cansubmittags`,`candeletetags`,`cansub mitfeeds`,`validatefeeds`,`validatefeeditems`,`numaliasestot `,`shoutsperday`,`validatetrader`,`renewdays`,`renewtimes` FROM wsnlinks_membergroups WHERE id>0

Load time so far: 0.11 seconds.

Query 4: SELECT `id`,`name`,`links`,`comments`,`time`,`usergroup`,`password` ,`ip`,`totalhits`,`totalhitsin`,`email`,`validated`,`templat e`,`language`,`lastattempt`,`allowemail`,`signature`,`avatar name`,`stylesheet`,`allowuseremail`,`albumid`,`failedattempt s`,`totalbytes`,`funds`,`notifyoflinks`,`lastvisit`,`timezon e`,`rating`,`pmfolders`,`notifyofpms`,`acceptpms`,`cookiedur ation`,`banned`,`location`,`homepage`,`occupation`,`bio`,`ai m`,`icq`,`msn`,`yahoo`,`inactive`,`timeonline`,`totalpms`,`b uddies`,`ignored`,`isonline`,`acceptims`,`adminpermissions`, `referrer`,`groupreverttime`,`grouprevertto`,`moderationpm`, `secondarygroups`,`linksperpage`,`commentsperpage`,`shouts`, `customtitle`,`shoutban`,`topicbans`,`forumbans`,`visibility `,`birthdate`,`lastsession`,`interests`,`posteditor`,`foruma ccess`,`pmpopup`,`pmnotify`,`modnotes`,`guestnotes`,`salt`,` lastmodnote`,`newpms`,`imflag`,`orderalbums`,`lastguestnote` ,`autosubscribe`,`notifymethod`,`showavatars`,`showsigs`,`wa rninglevel`,`topics`,`posts`,`chatcolor`,`traderrating`,`inv itessent`,`validatedemail`,`calsub`,`macros`,`guestnotify`,` keychecktime`,`notifykeywords`,`autosubscribepost`,`blogrss` ,`positivepct` FROM wsnlinks_members WHERE id='1' AND validated=1

Query 5: LOCK TABLES wsnlinks_email WRITE, wsnlinks_links WRITE, wsnlinks_categories WRITE, wsnlinks_members WRITE

Load time so far: 0.12 seconds.

Query 6: SELECT `id`,`to`,`subject`,`message`,`headers`,`replacement`,`mime` FROM wsnlinks_email WHERE timesent=0 ORDER BY id ASC LIMIT 0,10

Number of rows is 0

Query 7: UNLOCK TABLES

Query 8: INSERT INTO wsnlinks_searches(`value`,`memberid`,`catid`,`time`) VALUES('Divatmodell','1','','119 4467444')

Load time so far: 0.15 seconds.

Query 9: SELECT `id`,`title`,`url`,`description`,`rating`,`votes`,`validated `,`catid`,`sumofvotes`,`email`,`time`,`hits`,`numcomments`,` hide`,`ownerid`,`voterips`,`voterids`,`lastedit`,`type`,`not ify`,`suspect`,`pendingedit`,`funds`,`suspended`,`alias`,`ex pire`,`ip`,`inalbum`,`typeorder`,`recipurl`,`hitsin`,`recipw ith`,`hitsinips`,`hitsoutips`,`lastcomment`,`related`,`inhid den`,`viewers`,`threadviewers`,`hitsintemp`,`hitsouttemp`,`o rigtype`,`importance`,`parentids`,`timesdead`,`timesemailed` ,`threadclosed`,`threadposters`,`lastposterid`,`lastposterna me`,`ownername`,`deleted`,`deletionreason`,`movedto`,`delete dby`,`timevalidated`,`filefield`,`message`,`sticky`,`downloa ds`,`pollid`,`posticon`,`savedby`,`validatedemail`,`unpaid`, `recipverified`,`effectivetime`,`sugcatid`,`pagerank`,`wysih tml`,`movedid`,`unrevised`,`feedurl`,`feedcache`,`feedcachet ime`,`tags`,`xmlsource`,`ordercomments`,`lastpadupdate`,`pad file`,`lastmonthlycheck`,`invisibleto`,`profileurl`,`lastpro fileurl`,`timesrenewed`,`mellboseg`,`derekboseg`,`csipoboseg `,`cipo`,`suly`,`teljesnev`,`orszag`,`megye`,`telepules`,`ma gassag`,`konfekcio`,`gyakorlat`,`iranyitoszam`,`hajszin`,`sz emszin`,`tevekenyseg`,`oltozet`,`magamrol`,`megjelenes`,`ref erencia`,`nyelvtudas`,`tiltott`,`telefon`,`eletkor`,`szulina p`,`beljegy` FROM wsnlinks_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND deleted=0 AND alias=0 AND inalbum=0) AND ((effectivetime < 1194467444) AND (tevekenyseg 'Divatmodell')) ORDER BY hits DESC LIMIT 0,60

Load time so far: 0.15 seconds.

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 ''Divatmodell')) ORDER BY hits DESC LIMIT 0,60' at line 1

Query 10: SELECT COUNT(id) FROM wsnlinks_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND deleted=0 AND alias=0 AND inalbum=0) AND ((effectivetime < 1194467444) AND (tevekenyseg 'Divatmodell'))

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/apollo/public_html/databases/mysql.php on line 29
Count is

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/apollo/public_html/databases/mysql.php on line 26

Number of rows is 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 ''Divatmodell'))' at line 1

Load time so far: 0.2 seconds.

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 ''Divatmodell'))' at line 1

Query 11: SELECT COUNT(id) FROM wsnlinks_sessions WHERE memberid>0
Count is 1

Load time so far: 0.2 seconds.

Query 12: SELECT COUNT(id) FROM wsnlinks_sessions WHERE memberid=0 AND isrobot=0
Count is 3

Load time so far: 0.2 seconds.

Query 13: SELECT COUNT(id) FROM wsnlinks_sessions WHERE memberid=0 AND isrobot=1
Count is 2

Load time so far: 0.2 seconds.

Query 14: SELECT COUNT(id) FROM wsnlinks_sessions WHERE time > 1194466544
Count is 1

Load time so far: 0.2 seconds.

Query 15: SELECT `id`,`memberid`,`location`,`time`,`ip`,`browser`,`starttime` ,`catid`,`threadid`,`areaname`,`lastsearch`,`nopermission`,` inchat`,`name`,`isrobot`,`lastchat`,`groupnamestyle`,`accept ims`,`visibility`,`profileurl` FROM wsnlinks_sessions WHERE time > 1194466544 ORDER BY memberid desc,time desc LIMIT 0,300

Number of rows is 1

Load time so far: 0.3 seconds.

Query 16: SELECT `id`,`memberid`,`location`,`time`,`ip`,`browser`,`starttime` ,`catid`,`threadid`,`areaname`,`lastsearch`,`nopermission`,` inchat`,`name`,`isrobot`,`lastchat`,`groupnamestyle`,`accept ims`,`visibility`,`profileurl` FROM wsnlinks_sessions WHERE memberid=1

Number of rows is 1

Load time so far: 0.3 seconds.

Query 17: UPDATE wsnlinks_sessions SET starttime='1194461469', time='1194467444', location='http://www.apollomodel.net/search.php?action=filter&&whichtype=links', catid='', threadid='', areaname='Search Results', nopermission='0', inchat='0', ip='78.92.3.27' WHERE id=70




Since the database field is a text, and I had many values in it, they are divided with that ||| thingy. smiling face Is this causing the problem? How do you search a database field that had it's values set from a checbox form input?

Thanks
David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 11/08/07 - 09:39 AM:
quote post
#4
You can't do a search without telling it what sort of comparison you're trying to do -- it doesn't know if you want =, >, <, any of, etc since you haven't specified for any of those checkboxes.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 72
Total Posts: 220
Posted 11/08/07 - 09:56 AM:
quote post
#5
???


<input type="hidden" name="tevekenysegconditon" value="or">


I had that in there. What do you mean: "haven't specified for any of those checkboxes."

Thanks
David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 11/09/07 - 11:00 PM:
quote post
#6
I see, these checkboxes are all the same field... thought they were different fields. I don't recall any support for multiple value checkbox searhes. Was there a reference somewhere you were following? If it were supported it could only be done as an array, so they'd have to be tevekenysegconditon[] rather than tevekenysegconditon.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 72
Total Posts: 220
Posted 11/10/07 - 01:39 AM:
quote post
#7
Hmmm.... I think I did this type of search already a year ago in your script. I can't find that search template anymore though.

This is what I don't understand. If I have a text field, that has values like |||Divatmodell|||Sminkmodell|||Hajmodell|||Fotómodell and I want to search this field, then why doesn't simply giving the search of that field a condition of 'like' works? Shouldn't that technically just look for words that match the selected checkbox values?

It seems strange to me that you can do such things when editing this field in the LINK EDIT. Your script DOES match words (values) from that field, otherwise it wouldn't know which values have to be checked already. So the same concept should work in a search, shouldn't it?


<input type="hidden" name="tevekenysegconditon" value="like">
<input type="checkbox" name="tevekenysegsearch" value="Divatmodell"> Divatmodell
<input type="checkbox" name="tevekenysegsearch" value="Sminkmodell"> Sminkmodell
<input type="checkbox" name="tevekenysegsearch" value="Hajmodell"> Hajmodell
<input type="checkbox" name="tevekenysegsearch" value="Fotómodell"> Fotómodell


What about if I change this to a multiselect dropdown, and what about if I put ||| in front of the individual values?

I am surprised that it is possible to enter values into a field from checkboxes, then easily view and edit those values, but not search them. Paul, what can be done here?

Thanks
David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 11/10/07 - 09:46 AM:
quote post
#8
If I have a text field, that has values like |||Divatmodell|||Sminkmodell|||Hajmodell|||Fotómodell and I want to search this field, then why doesn't simply giving the search of that field a condition of 'like' works?

It does work. What your checkboxes are doing is just sending the value of one of your checks, since a variable can only hold one value unless it's an array. So if I guess browser behavior correctly, checking all the boxes should only turn up results for Fotómodell using the HTML you're using. Did a quick test and confirmed that this is indeed working.

In order to handle mutliple values you need an array, but you also need a ton of backend code which converts the array into a complex sequence of "or" conditionals which determine the various possible field values you could be searcing for -- since if you check Divatmodell and Hajmodell for example, you don't want to match just |||Divatmodell|||Hajmodell, you also want to match |||Divatmodell|||Sminkmodell|||Hajmodell.

I have a lot of higher priorities than a complex project like this which would endanger the stability of the 4.1 series, so I'll only take it on as a custom project in the near term.

Edited by Paul on 11/10/07 - 09:54 AM
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 72
Total Posts: 220
Posted 11/10/07 - 10:00 AM:
quote post
#9
Neg. It throws this back still:


Load time so far: 0.08 seconds.

Query 2: SELECT `name`,`value` FROM wsnlinks_switches WHERE id>0

Number of rows is 87

Load time so far: 0.09 seconds.

Query 3: SELECT `id`,`title`,`caneditown`,`caneditall`,`canvote`,`isadmin`,` canpost`,`canemail`,`validatecats`,`validatecomments`,`valid atelinks`,`validateedits`,`cansubmitlinks`,`cansubmitcategor ies`,`cansubmitcomments`,`caneditownlinks`,`caneditowncatego ries`,`caneditowncomments`,`caneditownprofile`,`caneditallli nks`,`caneditallcategories`,`caneditallcomments`,`caneditall profiles`,`candownloadfiles`,`canupload`,`canviewip`,`limitl inks`,`canemailmembers`,`canusehtml`,`limitlinksdaily`,`cana lias`,`cancopy`,`candeleteown`,`candeleteall`,`candofulledit `,`candeletecategories`,`candeletecomments`,`candeleteowncat egories`,`candeleteowncomments`,`candeletemembers`,`candelet eownmembers`,`canaliascategories`,`canviewpages`,`caneditvot es`,`numaliases`,`canviewvotes`,`canhideownlinks`,`canhideow ncategories`,`canhideowncomments`,`canhidealllinks`,`canhide allcategories`,`canhideallcomments`,`canratecomments`,`bytes permem`,`canpm`,`canim`,`canharddelete`,`limitpms`,`limitpms daily`,`canviewdeleted`,`cansubmitpolls`,`candeletepolls`,`c andeleteownpolls`,`caneditpolls`,`caneditownpolls`,`attachpe rpost`,`attachperpm`,`canviewshouts`,`caneditshouts`,`canedi townshouts`,`candeleteshouts`,`candeleteownshouts`,`cansubmi tshouts`,`canpollvote`,`customtitle`,`canviewinvisible`,`nam estyle`,`canpmimportant`,`canviewmodlog`,`isleader`,`cansubm itquotes`,`validatequotes`,`candeletequotes`,`candeleteownqu otes`,`canreport`,`canusesearch`,`attachperlink`,`validateat tachments`,`caneditownquotes`,`caneditallquotes`,`canviewcha t`,`caneditownevents`,`caneditallevents`,`candeleteownevents `,`candeleteevents`,`cansubmitevents`,`validateevents`,`bulk pms`,`issupermod`,`numinv`,`allowugspec`,`validateemails`,`v alidatesponsorlinks`,`cansubmittags`,`candeletetags`,`cansub mitfeeds`,`validatefeeds`,`validatefeeditems`,`numaliasestot `,`shoutsperday`,`validatetrader`,`renewdays`,`renewtimes` FROM wsnlinks_membergroups WHERE id>0

Load time so far: 0.11 seconds.

Query 4: SELECT `id`,`name`,`links`,`comments`,`time`,`usergroup`,`password` ,`ip`,`totalhits`,`totalhitsin`,`email`,`validated`,`templat e`,`language`,`lastattempt`,`allowemail`,`signature`,`avatar name`,`stylesheet`,`allowuseremail`,`albumid`,`failedattempt s`,`totalbytes`,`funds`,`notifyoflinks`,`lastvisit`,`timezon e`,`rating`,`pmfolders`,`notifyofpms`,`acceptpms`,`cookiedur ation`,`banned`,`location`,`homepage`,`occupation`,`bio`,`ai m`,`icq`,`msn`,`yahoo`,`inactive`,`timeonline`,`totalpms`,`b uddies`,`ignored`,`isonline`,`acceptims`,`adminpermissions`, `referrer`,`groupreverttime`,`grouprevertto`,`moderationpm`, `secondarygroups`,`linksperpage`,`commentsperpage`,`shouts`, `customtitle`,`shoutban`,`topicbans`,`forumbans`,`visibility `,`birthdate`,`lastsession`,`interests`,`posteditor`,`foruma ccess`,`pmpopup`,`pmnotify`,`modnotes`,`guestnotes`,`salt`,` lastmodnote`,`newpms`,`imflag`,`orderalbums`,`lastguestnote` ,`autosubscribe`,`notifymethod`,`showavatars`,`showsigs`,`wa rninglevel`,`topics`,`posts`,`chatcolor`,`traderrating`,`inv itessent`,`validatedemail`,`calsub`,`macros`,`guestnotify`,` keychecktime`,`notifykeywords`,`autosubscribepost`,`blogrss` ,`positivepct` FROM wsnlinks_members WHERE id='1' AND validated=1

Query 5: LOCK TABLES wsnlinks_email WRITE, wsnlinks_links WRITE, wsnlinks_categories WRITE, wsnlinks_members WRITE

Load time so far: 0.12 seconds.

Query 6: SELECT `id`,`to`,`subject`,`message`,`headers`,`replacement`,`mime` FROM wsnlinks_email WHERE timesent=0 ORDER BY id ASC LIMIT 0,10

Number of rows is 0

Query 7: UNLOCK TABLES

Query 8: INSERT INTO wsnlinks_searches(`value`,`memberid`,`catid`,`time`) VALUES('Divatmodell','1','','119 4717463')

Load time so far: 0.15 seconds.

Query 9: SELECT `id`,`title`,`url`,`description`,`rating`,`votes`,`validated `,`catid`,`sumofvotes`,`email`,`time`,`hits`,`numcomments`,` hide`,`ownerid`,`voterips`,`voterids`,`lastedit`,`type`,`not ify`,`suspect`,`pendingedit`,`funds`,`suspended`,`alias`,`ex pire`,`ip`,`inalbum`,`typeorder`,`recipurl`,`hitsin`,`recipw ith`,`hitsinips`,`hitsoutips`,`lastcomment`,`related`,`inhid den`,`viewers`,`threadviewers`,`hitsintemp`,`hitsouttemp`,`o rigtype`,`importance`,`parentids`,`timesdead`,`timesemailed` ,`threadclosed`,`threadposters`,`lastposterid`,`lastposterna me`,`ownername`,`deleted`,`deletionreason`,`movedto`,`delete dby`,`timevalidated`,`filefield`,`message`,`sticky`,`downloa ds`,`pollid`,`posticon`,`savedby`,`validatedemail`,`unpaid`, `recipverified`,`effectivetime`,`sugcatid`,`pagerank`,`wysih tml`,`movedid`,`unrevised`,`feedurl`,`feedcache`,`feedcachet ime`,`tags`,`xmlsource`,`ordercomments`,`lastpadupdate`,`pad file`,`lastmonthlycheck`,`invisibleto`,`profileurl`,`lastpro fileurl`,`timesrenewed`,`mellboseg`,`derekboseg`,`csipoboseg `,`cipo`,`suly`,`teljesnev`,`orszag`,`megye`,`telepules`,`ma gassag`,`konfekcio`,`gyakorlat`,`iranyitoszam`,`hajszin`,`sz emszin`,`tevekenyseg`,`oltozet`,`magamrol`,`megjelenes`,`ref erencia`,`nyelvtudas`,`tiltott`,`telefon`,`eletkor`,`szulina p`,`beljegy`,`timedeleted` FROM wsnlinks_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND deleted=0 AND alias=0 AND inalbum=0) AND ((effectivetime < 1194717463) AND (tevekenyseg 'Divatmodell')) ORDER BY hits DESC LIMIT 0,60

Load time so far: 0.15 seconds.

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 ''Divatmodell')) ORDER BY hits DESC LIMIT 0,60' at line 1

Query 10: SELECT COUNT(id) FROM wsnlinks_links WHERE (validated=1 AND hide=0 AND inhidden=0 AND deleted=0 AND alias=0 AND inalbum=0) AND ((effectivetime < 1194717463) AND (tevekenyseg 'Divatmodell'))

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/apollo/public_html/databases/mysql.php on line 29
Count is

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/apollo/public_html/databases/mysql.php on line 26

Number of rows is 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 ''Divatmodell'))' at line 1

Load time so far: 0.2 seconds.

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 ''Divatmodell'))' at line 1


I selected Divatmodell only from the checkboxes, and I have a link that has Divatmodell in its 'tevekenyseg' field value.

Is there a way that you can test this yourself? A simple text link field, say 3 different checbox values to it, then try a search in that field?

Thanks
David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 11/10/07 - 03:54 PM:
quote post
#10
My advanced search template contains
<form action="http://www.webmastersite.net/forums/search.php?action=filter&filled=1&whichtype=links" method="post">
{LANG_SEARCH_FINDLINKSWHERE}

<input type="hidden" name="testcheckcondition" value="like" />
<input type="checkbox" name="testchecksearch" value="op1" /> op1
<input type="checkbox" name="testchecksearch" value="op2" /> op2
<input type="checkbox" name="testchecksearch" value="op3" /> op3
<input type="checkbox" name="testchecksearch" value="op4" /> op4
, and checking one of the boxes brings up a resulting link for which I checked all the boxes. Of course it's not going to search multiple values as explained above, just ignores other selections.

Did you see my above post after the 9:54 edit?
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 72
Total Posts: 220
Posted 11/10/07 - 04:20 PM:
quote post
#11
My apologies Paul, I didn't see the edit on the post. smiling face

I see your point. Darn, I thought this was something simple. grin
Oh well, no worries man, I'll just create a new individual field for each of the values I originally had.

Thanks Paul, sorry to have bothered you with this.

David
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

Admin Control Panel

   
Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support
© 2008 Paul Knierim. All rights reserved.