473,396 Members | 1,758 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,396 software developers and data experts.

show specific data from database with php

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_result($jtsstatus,"TrackingStatus")) == "") { echo("Not Released"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "Y") { echo("Released"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "S") { echo("Shipped"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "I") { echo("Invoiced"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "L") { echo("Inner Layers"); }
?> [/PHP]
Dec 4 '07 #1
1 2134
Markus
6,050 Expert 4TB
[php]
$query = "SELECT * FROM `table_name` WHERE `shipped_status` = 'no' "
[/php]

Something like that?
Dec 4 '07 #2

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

Similar topics

2
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...
3
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...
4
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...
1
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...
4
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...
4
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...
2
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...
3
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...
39
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
0
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...

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.