vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Multiple Checkboxes Search Help ? (https://vborg.vbsupport.ru/showthread.php?t=69717)

RobinHood 09-22-2004 02:04 AM

Multiple Checkboxes Search Help ?
 
Hi,

I'm trying to create a new search script that would search into the DB using checkboxes. I just can't figure out how I would do that in MySQL.

Here is the search page: http://www.findacupid.com/search.php

This is what the "lookingfor" field data looks like: "2 3 5 6 8 9 12 15".

How would I make it so it can search for a user that has only 5 and 15 in that field?

Thanks for your help.

Tekton 09-22-2004 04:27 AM

Well if you are storing it as a string like that, I'd explode the string, and then search through it with a while() or something...

PHP Code:

$id=0;
$temp explode(" "$fullstring);
while (
$search fetch_array($temp)){
// check values with $search[$id]
$id++;


I could probably go a little more in depth for the searching part... if this is really the way you'd want to do it, which I'm not too sure about. I'm not exactly the cleanest coder out there... ;)

I'd assume you want to compare if it was == to a value that you store in another var.


All times are GMT. The time now is 08:21 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01593 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete