Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
PHP Server Side Scripting
6:24 pm Apr 28, 2026
This page requires javascript.
Forum Moderators:
coopster
Message Too Old, No Replies
Calling data from database column
I need to call some info from a database column
AlvinSA
Msg#:4072229
8:56 pm on Feb 1, 2010
(gmt 0)
Hi
I have a database table with column called "date_expire".
I'm looking to code something that says:
<?php if($databasecolumn['date_expire'] > 'x') { Do something } else { Do nothing } ?>
As you can see I'm new to this. Please help.
rocknbil
Msg#:4072350
11:31 pm on Feb 1, 2010
(gmt 0)
I have a database table with column called "date_expire".
Do it right in your select.
$some_date = '2010-02-01';
$query = "select date_expire > '$some_date'";
or,
$query = "select date_expire > curdate()";
This will return a 1 for true, 0 for false.
$expired_text = Array ('EXPIRED','NOT EXPIRED');
<?php echo $expired_text[$is_expired]; ?>
where $is_expired is the value returned from the query.
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Mar
,
Feb
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
April 2026 Google Search Observations
what do they want?
Do you get tired of others copying your content?
AdSense Earnings and Observations - April 2026
Hello again, it's been a while
5 SEO Tips That Actually Worked for My Blog in 2026
iPhone Safari 26.4.1 errors: IPv4 & Host
I need some SEO help
Does SEO matter any more?
SEO question
Home
Forums Index
Server Side
/
PHP Server Side Scripting
6:24 pm Apr 28, 2026