Unix Technical Forum

How to make a Query with diffrent variables, beeing empty or not?

This is a discussion on How to make a Query with diffrent variables, beeing empty or not? within the DB2 forums, part of the Database Server Software category; --> Hello all, im new here so bare with me This is what i have: $queryzoeken = ("SELECT SNR, SNM, ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 04:50 AM
haraldstoll@gmail.com
 
Posts: n/a
Default How to make a Query with diffrent variables, beeing empty or not?

Hello all, im new here so bare with me

This is what i have:

$queryzoeken = ("SELECT SNR, SNM, SOMS, SVER, SSER, SLEV, SLIC, SLM
FROM software
WHERE SNR = $array[snr]

(!!if $array[snr is filled in then also look use it in the query!!)

AND snm = $array[snr]");


$result = mysql_query( $queryzoeken);

Explanation: User inputs one or more of these variables:
$array[snr]
$array[snm]
etc.


I need the server to look up the query with tha variables the use has
filled in, and leave out the ones that are empty.

Can anyone help me out with this?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:55 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com