#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0

    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    676
    Rep Power
    7
    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!

IMN logo majestic logo threadwatch logo seochat tools logo