473,651 Members | 2,750 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 1492
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
8278
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 add one. The problem comes in with the properties for the registry key search. The properties are RegKey and Value. In viewing the registry editor, the registry key is Software\Microsoft\DirectX. Within that, you have a value name and a value...
4
1767
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 = "INSERT OrderStatusAccess (UserID, Password, Email, CustomerID) values ('" & vUser & "', '" & vPass & "', '" & vEmail & "', '" &
5
2370
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, check boxes, date pickers, combo boxes and datagrids). I have been coding alone on this project for about a year, and I have experienced many problems which have not been addressed by various SP's, including the recent SP1 to Framework.NET 1.1,...
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 functionality. I have Edit and Delete columns that each contain the ColumnID for the record I want to either edit, or delete. When I pull the item of the collection on the target page's page_load event, I will be able to either invoke a delete or an edit...
3
3515
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, while the C# for loop ending condition is evaluated on every iteration." Is this accurate? I don't understand how you could get away without evaluating the ending condition at every iteration. Otherwise, how would you
3
3490
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 condition isn't true? (e.g. by throwing an error message to the compiler). And is it possible to use this type of condition to make the compiler choose the best method (between some others). Here is an example to illustrate my question:
4
1894
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 use to build bricks of more complex condition, conditions are based on fields by using regexp class Condition:
16
3514
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 instructions which can sure be optimized away is the check for the break condition, at least within the time where it is known that the loop will not reach it. Any idea how to write such a loop? e.g.
0
1127
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 other rows in the DataGrid. I want that only those rows whose If condition evaluates to True should go into the editable mode when the Edit link in the EditCommandColumn is clicked where as the rows whose If condition evaluates to False shouldn't...
0
8352
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8802
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6158
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1587
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.