PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 23rd, 2013, 08:04 PM
pghutch pghutch is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 7 pghutch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 11 sec
Reputation Power: 0
PHP5 - If Then Statement In a query output

I have this code:


Query Stuff here then

<tr>
<td width="20" align="left">
<input type="checkbox" checked name="Employee_ID" value="[ PHP] echo $row->ID[ /PHP]"/>
</td>

<td class="crewlist_cell">
<a href="employee_detail.php?[ PHP] echo ID ?>=[ PHP] echo $row->ID;[ /PHP]" >

[ PHP] echo $row->Name_FirstLast;

echo '</a></td>
<td class="crewlist_time">------Here --------</td></tr>'[ /PHP]


Anyway where it says -----Here -------- I want the display to show 8:00 for all ID's except if the ID is 11 and if its 11 then I want it to show 9:15.

So it would be if ID =11 then show 9:15 else 8:00.

Anyway I cant seem to get it to work

Reply With Quote
  #2  
Old January 23rd, 2013, 08:53 PM
Triple_Nothing Triple_Nothing is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 294 Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 8 h 5 m 6 sec
Reputation Power: 5
Have you attempted any If/Then yet with this setup? A simple If/Then with desired values make this extremely basic. Perhaps set a variable with your items like:

PHP Code:
if($id == 11) {
  
$time "9:15";
} else {
  
$time "8:00";



Or a simple shorthand version:

PHP Code:
 $time = ($id == 11 "9:15" "8:00"); 


You may even attempt to slip the shorthand version directly into your echo. Whatever works best for ya. Good luck!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP5 - If Then Statement In a query output

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not 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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap