473,395 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problem realted to database please

how to search from the database when we have multiple textbox and condition is that user can search from any of the textbox
Expand|Select|Wrap|Line Numbers
  1. //$akp=mysql_query("select * from enquiry where name='".$_REQUEST['name']."'or  id='".$_REQUEST['id']."' or  email='".$_REQUEST['email']."'or  mobile='".$_REQUEST['mobile']."' " );//(its not wroking)
Mar 25 '14 #1
1 1042
Luuk
1,047 Expert 1GB
I think you should build your sql-statment like this:
Expand|Select|Wrap|Line Numbers
  1. $sql = "select * from enquiry where "
  2. if $_REQUEST['name']<>"" then $sql .= " or name='".$_REQUEST['name']."' ";
  3. if $_REQUEST['id']<>"" then $sql .= " or  id='".$_REQUEST['id']."';
  4. ....
  5. $akp=mysql_query($sql);
  6.  
and finally about "(its not wroking)"
please, next time, tell here why you think "its not working".....
don't let the reade guess about why you think it does not work....
Mar 25 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Barnes | last post by:
I have an asp form that sends data to a redirect page with SQL using JScript. There is a function that I'm using called replace(). The form submits without errors and goes to the redirect page but...
11
by: Jay King | last post by:
Ok I'm very new to the whole database thing, my problem is I'd like to use firebirds embeded database engine so I can just send it as some stand alone dlls to my user with my main program. I have...
1
by: Dominik Szczurek | last post by:
Hello to anyone who is tring to help me :-) As I was writed in the topic I have problem when somone input 0 value in the form. PHP is losting this value when it try to write it to mySQL. I have...
5
by: Ramtin | last post by:
Hi; when I use sql server connection or ole connection for working with database I receive the login failed for user 'any user that I work'.I've been granted ASPNET user in sql.
8
by: supasnail | last post by:
I have a happily working set of asp pages which read from the database via include file "./_private/include/database.mdb". However, when I try to gain access to this database on pages one folder...
0
by: pratush | last post by:
hi friends, Can anyone tell me what is wrong with this in IBM DB2 7.2. I am getting a problem while creating a local database through stored procedure . i am add it manually and giving the TCP\ip...
1
by: saajanji | last post by:
we are using the Express Edition of SQL SERVER 2005 right now..... I want to configure Database mail.......... So for this what shall we use or which Edition should be used.......it is very...
4
by: abdulaziz68 | last post by:
I have gridview in asp.net ( c# ) , and i have to column in gridview 1st column it's a number and 2nd column it's a color , and I use SQL server database and I used sqldatasource in asp.net .. The...
4
by: Jeffrey Tan | last post by:
So this whole database I'm working on at work is a problem-tracking database where my colleagues keep track of user & printer problems. I would like to know if there are any notable features that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.