Hello all
Hopefully someone can help me with this issue.
I have some information from a database which i show in a table. In this table i have various columns that are filled out with some of the data from the database.
I have a column named status where the information i get from the database can have 4 different values - Not released, Released, Inner layers, Shipped.
What i need is some php code that tells not to show data when the value is Shipped.
Here is some code i use to retrieve the information from the database, if it is any help:
[PHP]if (trim($_SESSION['StatusREL']) == "Y") {
$query = $query . " AND (TrackingStatus = '" . trim($_SESSION['StatusREL']) . "'";
$andused = true;
}
if (trim($_SESSION['StatusSHP']) == "S") {
if (!$andused) {
$query = $query . " AND (TrackingStatus = '" . trim($_SESSION['StatusSHP']) . "'";
$andused = true;
} else {
$query = $query . " OR TrackingStatus = '" . trim($_SESSION['StatusSHP']) . "'";
}
}
if (trim($_SESSION['StatusINV']) == "I") {
if (!$andused) {
$query = $query . " AND (TrackingStatus = '" . trim($_SESSION['StatusINV']) . "'";
$andused = true;
} else {
$query = $query . " OR TrackingStatus = '" . trim($_SESSION['StatusINV']) . "'";
}
}
if (trim($_SESSION['StatusNR']) == "NR") {
if (!$andused) {
$query = $query . " AND (TrackingStatus = ' '" ;
$andused = true;
} else {
$query = $query . " OR TrackingStatus = ' '";
}
}
if (trim($_POST['FromDate']) != "" AND trim($_POST['ToDate']) != "") {
$query = $query . " AND (DockDate >= '" . trim($_POST['FromDate']) . "' AND DockDate <= '" . trim($_POST['ToDate']) . "')";
}
// Now put on the closing paren
if (trim($_SESSION['StatusREL']) == "Y" || trim($_SESSION['StatusNR']) == "NR"
|| trim($_SESSION['StatusSHP']) == "S" || trim($_SESSION['StatusINV']) == "I" ) {
$query = $query . " )";[/PHP]
And
[PHP]<?php
if (trim(ads_resul t($jtsstatus,"T rackingStatus") ) == "") { echo("Not Released"); }
if (trim(ads_resul t($jtsstatus,"T rackingStatus") ) == "Y") { echo("Released" ); }
if (trim(ads_resul t($jtsstatus,"T rackingStatus") ) == "S") { echo("Shipped") ; }
if (trim(ads_resul t($jtsstatus,"T rackingStatus") ) == "I") { echo("Invoiced" ); }
if (trim(ads_resul t($jtsstatus,"T rackingStatus") ) == "L") { echo("Inner Layers"); }
?> [/PHP]
1 2148 Markus 6,050
Recognized Expert Expert
[php]
$query = "SELECT * FROM `table_name` WHERE `shipped_status ` = 'no' "
[/php]
Something like that?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Samuel R. Neff |
last post by:
What options are available for doing full-text searches of database
data without using a database-specific full-text engine?
The only option I've found is Google's Search Appliance but it's an
expensive hardware solution and we prefer a software solution.
In the past I've used development languages that had OEM Verity
support which was wonderful but as far as I can tell the only
out-of-the-box search available in ASP.NET is Index...
|
by: Marc Jennings |
last post by:
I have an architectural question that I would appreciate some input
on, please.
Earlier this year I spent some time in Sri Lanka working with a
rpoject to help after the tsunami. A part of the work I was doing was
centered around an Access database to keep track of the residents of
the IDP (Internally Displaced People) camps in the Galle area. The
solution I had to implement was to take data from each of a dozen or
so "local"...
|
by: cooltech77 |
last post by:
Hi,
I am trying to build the following functionality in the datagrid.
I have a lot of columns in the datagrid which are being populated from the
database and the user needs to scroll horizontally to view these coloumn
names.
So I want to group them into
categories which will fit into a page.
A user clicks a category and the category should
|
by: msmith |
last post by:
MSSQL Server 2000 SP3 in both houston and memphis
I have a database in houston, lets call it RED. Specific tables from
database RED are copied to database BLUE. Database BLUE is then backed
up, ftp'd to memphis and restored. In memphis there is a single table
in this database that will not open in enterprise manager when you
choose to open all rows you get a generic ODBC timeout error no numbers
just simply "TIMEOUT".
If I log...
|
by: Mike |
last post by:
I encountered this problem for the first time today while trying to add
some columns to a query from a linked DBASEIII file. The new columns
that I added on the design grid do not show up on the data sheet, even
though the box is checked. I've already done some trouble shooting,
making sure the box is checked, making sure that the columns aren't
hidden.
Also, I went to the toolbar menu, under tools and then options, and
checked the...
| |
by: nairda |
last post by:
Hi all,
I have a MSHFlexgrid to show my database and some textboxes to show datas I choosed from MSHFlexgrid.
I would like to know if there's a way to show a specific data I choosed from MSHF in my textbox by double-clicking the data in MSHF.
I know these script:
Private Sub DGrid DblClick()
With DGrid
Text1.Text = .Columns(0).Text
|
by: Sudhakar |
last post by:
hi
I am using MySQL - 4.1.22 when i use the following sql query
$result = mysql_query("SHOW tablename STATUS FROM databasename;");
i have also tried = $result = mysql_query("SHOW tablename STATUS FROM
databasename");
i get the following error message
|
by: Margie |
last post by:
Hello all, after getting no where with my Access 2007 database problem for an entire week I figured I could use some outside help.
Wanting to skill myself in Access, I decided to make a movie database, something I always wanted. It took me some trial and error, but as it now stands, I made several tables (Companies, Cast, Genre, Country, Character, Director, Status, Movies)... The table Movies contains all the info on each movie while the...
|
by: alex |
last post by:
I've converted a latin1 database I have to utf8. The process has been:
# mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore
--skip-set-charset mydb mydb.sql
# iconv -f ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql
mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |