home
hardware prices
news
articles
forums
photos
user reviews
Tech Support Forums - TechIMO.com
>
PC Hardware and Tech
>
Webmastering and Programming
IF statement with MYSQL
Join TechIMO for Free!
User Name
Remember Me?
Password
Register
Blogs
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Get bargains at
»
Thread Tools
Currently Active Users
: 2862
Discussions: 188,380, Posts: 2,243,466, Members: 232,608
August 11th, 2002, 03:07 PM
#
1
(
permalink
)
grandma
Member
Join Date: Mar 2002
Location: Northern Michigan
Posts: 89
IF statement with MYSQL
If Statement with MYSQL
I have a simple page that prints out a Mysql database. The fields are type VARCHAR(255).
Some of the fields are blank/empty. Can someone help me with the IF statement that will not print/display it.
....
....
print "<tr><td width=\"20%\" > <B> Hours </B></td>". "<td width=\"75%\">". $row["Hours"] . "</td></tr>";
print "<tr><td width=\"20%\" > <B> Contact </B></td>". "<td width=\"75%\">". $row["Contact"] . "</td></tr>";
print "<tr><td width=\"20%\" > <B> Address </B></td>". "<td width=\"75%\">". $row["Address"] . "</td></tr>";
print "<tr><td width=\"20%\" > <B> Phone </B></td>". "<td width=\"75%\">". $row["Phone"] . "</td></tr>";
print "<tr><td width=\"20%\" > <B> Fax </B></td>". "<td width=\"75%\">". $row["Fax"] . "</td></tr>";
....
TIA
Grandma
TechIMO.com Ads - Login or
register
for less ads.
Guest
,
Register Free!
to remove this ad and get your tech support questions answered in minutes!
August 11th, 2002, 10:22 PM
#
2
(
permalink
)
gothic
Member
Join Date: Oct 2001
Location: Palatine, IL
Posts: 375
Er...Where is the 'if' statement?
August 12th, 2002, 12:35 AM
#
3
(
permalink
)
qball
Banned
Join Date: Oct 2001
Posts: 447
[deleted]
existing answer, better.
[/deleted]
August 12th, 2002, 08:25 AM
#
4
(
permalink
)
grandma
Member
Join Date: Mar 2002
Location: Northern Michigan
Posts: 89
That's exactly it. I was looking for one
Anyway, problem was solved. Rather simple and I'm embarrassed I couldn't get it on my own.
if ($row["Hours"] != "")
{
print "<tr><td width=\"20%\" > <B> Hours </B></td>". "<td width=\"75%\">". $row["Hours"] . "</td></tr>";
}
Thanks for asking
Grandma
August 13th, 2002, 05:16 PM
#
5
(
permalink
)
gothic
Member
Join Date: Oct 2001
Location: Palatine, IL
Posts: 375
Ooooh...hah...Hey, maybe I should learn to read, huh?
=]
August 13th, 2002, 10:33 PM
#
6
(
permalink
)
qball
Banned
Join Date: Oct 2001
Posts: 447
well lump me with gothic, doh.
Had I read properly, would have realized the question is actually PHP, working on resultset from MySQL db.
Glad we could be so unhelpful and you got a sufficient answer...
«
getting an error on loading a page..
|
visual sourceSafe & interDev
»
Currently Active Users Viewing This Thread: 1
(0 members and 1 guests)
Thread Tools
Show Printable Version
Email this Page
Posting Rules
You
may
post new threads
You
may
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
Off
Pingbacks
are
On
Refbacks
are
Off
Most Active Discussions
Is It Just Me?
(
2885
)
The United States Debt
(
20
)
Looks like Burris will get his Sena..
(
8
)
I think I just killed my computer w..
(
24
)
Upgrading RAM
(
5
)
Folderchat Weekday thread
(
439
)
Antec 300 bulk purchase?
(
11
)
Worth the upgrade??
(
14
)
Help with an Ati Radeon HD 4850 512..
(
25
)
Recent Discussions
RCA 52Inch HDTV wont turn on
(
1
)
Building a gaming computer advi..
(
1
)
Best digital camera for under 2..
(
14
)
Help with an Ati Radeon HD 4850..
(
25
)
Install Problem for Windows Def..
(
0
)
New Build ( Finally )
(
1
)
dual monitors wont boot
(
0
)
Folderchat Weekday thread
(
439
)
MSN Hotmail Down???
(
7
)
Blackberry Storm, Gears of War ..
(
1
)
Core 2 Quad Q9550 system
(
3
)
COWBOOM Ripoff! Used Laptop w/$..
(
4
)
All times are GMT -4. The time now is
08:49 PM
.
TechIMO Copyright 2008
All Enthusiast, Inc.
Contact Us
-
Tech Support Forums - TechIMO.com
-
Archive
-
Privacy Statement
-
Terms of Use
-
Coupons and Deals and Dealighted
-
Store Ratings and Reviews
-
Web Business Blog
-
Top
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28