473,503 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

additional sql WHERE condition

60 New Member
hi,

i have the following:

Expand|Select|Wrap|Line Numbers
  1. $sql="SELECT admitday, shift, infocount FROM qry_sum WHERE admitday ='".$count."'";
  2.  
i would like to know how i can add an additional AND WHERE code = html form field. i am just not sure of the syntax.

thanks in advance,
geebee
Jan 13 '09 #1
5 1482
Markus
6,050 Recognized Expert Expert
Simply add AND to your SQL, like so:

Expand|Select|Wrap|Line Numbers
  1.  
  2. $query = "SELECT `row1` FROM `tbl1` WHERE `row2` = 0 AND `row3` = 1";
  3.  
  4.  
Hope this helps,
Markus.
Jan 13 '09 #2
geraldjr30
60 New Member
thanks.. i figured it out... you also need the following to remember the form field upon form posting:

Expand|Select|Wrap|Line Numbers
  1. $FLD= $_POST["FLD"];
  2.  
Jan 13 '09 #3
Markus
6,050 Recognized Expert Expert
@geraldjr30
What does that have to do with your question?
Jan 13 '09 #4
geraldjr30
60 New Member
i noticed that without it the page does not remember the posted form value to be used in the WHERE clause
Jan 13 '09 #5
Markus
6,050 Recognized Expert Expert
@geraldjr30
Ok. Glad you got it working.

Markus.
Jan 13 '09 #6

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

Similar topics

2
8257
by: Kendal Goodrich | last post by:
In the setup project I am trying to create, I am wanting to search to see if DirectX 8 is installed on the local machine. I figured the best way to determine would be a registry key search, so I...
4
1756
by: David | last post by:
Hi, I have the following code which adds a record to a table: vUser = request.form("user") '(UserID = PK in table) vPass = request.form("pass") vEmail = request.form("email") uSQL =...
5
2360
by: sdbranum | last post by:
I have been using Visual C#.NET to code a large project having many data adapters, data sets, datagrids, multiple forms with tab pages, each containing various controls (mostly label, text boxes,...
0
244
by: Hazzard | last post by:
I am trying to figure out how to add an additional value to a querystring collection so that when I click on a datagrid cell, there will be a key to distinguish it from another column's...
3
3504
by: Ben R. | last post by:
In an article I was reading (http://www.ftponline.com/vsm/2005_06/magazine/columns/desktopdeveloper/), I read the following: "The ending condition of a VB.NET for loop is evaluated only once,...
3
3484
by: Yohan | last post by:
Hello, I have a question concerning the template classes and their parameters. Is it possible to set a condition on the template parameters in a way that could block the compilation if the...
4
1886
by: joh12005 | last post by:
Hello, i posted for suggestions a little idea even if it still needs further thoughts but as i'm sure you could help :) if would like to implement some kind of Condition class which i coud...
16
3490
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of...
0
1117
by: RN1 | last post by:
I have a DataGrid with an EditCommandColumn. In the EditCommand sub of the DataGrid, there is an If condition. This If condition is True for some rows in the DataGrid whereas it is False for the...
0
7202
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
7086
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
7280
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
7330
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...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.