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

How to change text/cell colour in data display from mysql table

2
I have a page that displays all of the entries from the mqsql database table .

the insert page has a field for status . I wanting if the entry is submitted with the field being high for the record on the display form to be red .

Ive just got a bit confused at not sure how to go about this .

Thanks
Oct 15 '07 #1
3 4996
ronverdonk
4,258 Expert 4TB
Can you please explain what you mean by
.. "I wanting if the entry is submitted with the field being high for the record on the display form to be red..."
so we can understand your problem better.

Ronald
Oct 15 '07 #2
amyj
2
hI

Il try and explain it at bit better for you .

I have create a table within phpadmin called errors where people log a error via a php/html form . One of the value which needs to be submitted on the form is - status E.g Low medium High .

Then i have a page which lists all the errors contained the mysql table . The page is displayed as a table which each indvidual error .

How do i go about turning the status cell in this table to red if high has be inserted .

Hope that has explained it better

Thanks Amyj
Oct 16 '07 #3
ronverdonk
4,258 Expert 4TB
I haven't seen your code, so I must guess. Assuming that you have the value (low, medium, high) stored from $_POST into a variable named $risk, and you build the <td> entries yourself, you can build the table entry to-be-colored like:
[php]
$style = '';
if ($risk == 'high')
$style=' style="background-color:red;" ';
echo "<td$style>$risk</td>";[/php]
Ronald
Oct 16 '07 #4

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

Similar topics

6
by: Louise | last post by:
Hi I have written an HTML pages which does not have any colour specifying tags as far I know. When I view this in an Microsoft internet explorer browser it appears with a white background and...
5
by: coolsti | last post by:
Can someone tell me how to do this if it is possible? I have a table based web site, and I would like to dynamically change the text that is shown in a particular cell of a table. I give the cell...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
11
by: SarahMarsden | last post by:
I'm new to Dreamweaver (using MX 2004). I have a 2 row 3 column table. I have set each column to 200 pixels. The second row I have merged into one cell. When I enter text (or anything else) into...
14
by: Eric Lindsay | last post by:
I've seen a page using display, and especially display table that did some neat things with boxes, but basically it only worked with Mozilla browsers. Fell over fairly badly with Opera and Safari...
1
by: Terry | last post by:
I have a form which displays data from both the Student Details table and the Exam Details table. The Name (Text Box) control is from the Student Details table and the Withdrawn (Check Box)...
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
0
by: satish | last post by:
I have a table with two columns field1 int,Field2 and added a column to datagrid on runtime sum (field1+field2) ,upon changing the data in either of the fileds the sum field or column too changes ....
1
by: satish | last post by:
I have a table with two columns field1 int,Field2 and added a column to datagrid on runtime sum (field1+field2) ,upon changing the data in either of the fileds the sum field or column too changes ....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.