Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7890565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:23:14+00:00 2026-06-03T06:23:14+00:00

My databse is: CREATE TABLE `user` ( `id` int(4) NOT NULL auto_increment, `name` varchar(77)

  • 0

My databse is:

CREATE TABLE `user` (
  `id` int(4) NOT NULL auto_increment,
  `name` varchar(77) NOT NULL,
  `pass` varchar(77) NOT NULL,
  `datetime` varchar(22) NOT NULL,
  `level` varchar(33) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

INSERT INTO `user` VALUES (1, 'majid', '123', '2012-04-16', 'admin');
INSERT INTO `user` VALUES (2, 'feras', '123', '2012-04-15', 'gs');
INSERT INTO `user` VALUES (3, 'sami', '123', '2012-04-12', 'gs');
INSERT INTO `user` VALUES (4, 'rashed', '123', '2012-04-09', 'gs');
INSERT INTO `user` VALUES (5, 'saad', 'dfd', '2012-04-13', 'bb');

My search page is a form with three dropdown lists… first for name, second for pass and third for level.

Now, if I choose one drop list it will gives me a good result, but if I choose two or more lists it does not give me anything.

How can I make all that dropdown lists act like a filter for a specific result?
Like “all pass (123) and level (gs)”

My query is:

$name= $_GET['name'];
$pass= $_GET['pass'];
$level= $_GET['level'];
mysql_select_db($database_sqltest, $sqltest);
$query_Recordset1 = "SELECT * FROM user WHERE '$name' OR pass LIKE '$pass' OR level LIKE '$level'";
$Recordset1 = mysql_query($query_Recordset1, $sqltest) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:23:15+00:00Added an answer on June 3, 2026 at 6:23 am

    You need to use AND operator instead of OR to increase specificity and limit the query. I’ve added % signs (wildcards) so that a search for “12” would match pass “123”. You can remove them if you won’t want that functionality.

    $query_Recordset1 = "SELECT * FROM user WHERE `pass` LIKE '%$pass%' AND `level` LIKE '%$level%' AND `name` LIKE '%$name%'";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CREATE TABLE `banned_ip` ( `id` INT( 25 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
CREATE TABLE `django_comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content_type_id` int(11) NOT NULL, `object_pk`
Consider the following database schema: create table UserGroup ( id int not null auto_increment,
With the following tables CREATE TABLE `Play` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id`
Consider the following SQL: CREATE TABLE USER1 ( pkUSER1_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
I have the following MySQL scripts: CREATE TABLE user_roles ( id INT AUTO_INCREMENT, PRIMARY
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I created the following table for user to user subscriptions. CREATE TABLE IF NOT
I have 2 tables in my mysql database: CREATE TABLE IF NOT EXISTS `RECIPES`
With this code: var db = google.gears.factory.create('beta.database'); db.open('cominar'); db.execute('CREATE TABLE IF NOT EXISTS Ajax

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.