Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Date query

  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date query

    <?php

    mysql_connect("localhost","root","");
    mysql_select_db("npa");

    $date = date("Y-m-d");
    $date1 = mysql_query("SELECT Date_Recieved, CURDATE(), (YEAR(CURDATE())-YEAR(Date_Recieved)) - (RIGHT(CURDATE(),5)<RIGHT(Date_Recieved,5)) from dis");
    $r = mysql_query("Update dis set Date_Added='$date1'");
    $q = mysql_query("SELECT * from dis");

    while ($row = mysql_fetch_assoc($q)) {
    $html .= "<center><form>
    <table cellpadding='0' border='0' cellspacing='0'><tr>
    <td valign='top'><table width='400'>
    <tr><td>File Ref</td><td>&nbsp;</td>
    <td>$row[File_Ref]</td></tr>
    <tr><td>Employee Firstname</td><td>&nbsp;</td>
    <td>$row[Employee_Firstname]</td></tr>
    <tr><td>Employee Lastname</td><td>&nbsp;</td>
    <td>$row[Employee_Lastname]</td></tr>
    <tr><td>Persal Number</td><td>&nbsp;</td>
    <td>$row[Persal_Number]</td></tr>
    <tr><td>Occupation</td><td>&nbsp;</td>
    <td>$row[Occupation]</td</tr>
    <tr><td>Level</td><td>&nbsp;</td>
    <td>$row[Level]</td</tr>
    <tr><td>Gender</td><td>&nbsp;</td>
    <td>$row[Gender]</td</tr>
    <tr><td>Race</td><td>&nbsp;</td>
    <td>$row[Race]</td</tr>
    <tr><td>Suspension</td><td>&nbsp;</td>
    <td>$row[Suspensions]</td</tr>
    <tr><td>Period</td><td>&nbsp;</td>
    <td>$row[Period]</td></tr>
    <tr><td>Date Recieved</td><td>&nbsp;</td>
    <td>$row[Date_Recieved]</td</tr>
    <tr><td>Unit</td><td>&nbsp;</td>
    <td>$row[Unit]</td</tr>
    <tr><td>Region</td><td>&nbsp;</td>
    <td>$row[Region]</td</tr>
    <tr><td>Date Of DC</td><td>&nbsp;</td>
    <td>$row[Date_Of_DC]</td</tr>
    <tr><td>Status</td><td>&nbsp;</td>
    <td>$row[Status]</td</tr>
    <tr><td>Category</td><td>&nbsp;</td>
    <td>$row[Category]</td></tr>
    <tr><td>Outcome</td><td>&nbsp;</td>
    <td>$row[Outcome]</td></tr></table></td><td>&nbsp;</td><td valign='top'><table width='400'>
    <tr><td valign='top'>Status Report</td><td>&nbsp;</td>
    <td width='250'>$row[Status_Report]</td></tr>
    <tr><td>$row[Date_Added]</td></tr>
    </table></table>
    </form>";
    };
    ?>
    <html><head><title></title><link rel='stylesheet' href='stylesheet.css' type='text/css'>
    <style>

    a:link{font-family:'Times New Roman';
    font-size:10pt;
    color:'#ffffff';
    font-weight:700;
    text-decoration:none;
    }

    a:visited{font-family:'Times New Roman';
    font-size:10pt;
    color:'#ffffff';
    font-weight:700;
    text-decoration:None;
    }

    a:hover{font-family:'Times New Roman';
    font-size:10pt;
    text-decoration:none;
    color:'#B37A04';
    font-weight:700;
    }

    a:active{font-family:'Times New Roman';
    font-size:10pt;
    color:'#ffffff';
    font-weight:700;
    }

    </style></head><body bgcolor='#FDCC67' topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0'>
    <center><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
    <tr><td valign='top' width='140' bgcolor='#000000'>

    <a href='home.html'>Home[/url]


    <a href='view.php'>View Records[/url]


    <a href='add.html'>Add Record[/url]


    <a href='edit1.php'>Edit Record[/url]


    <a href='delete1.php'>Delete Record[/url]


    <a href='report.php'>View Report[/url]


    <a href='q.php'>Query Report[/url]


    <a href="search1.php">Search[/url]</td><td valign="top" align="center"><table><tr>
    <td align="right" valign="top"><form action="search2.php" method="post">Search by Persal Number:&nbsp;&nbsp;<input type="text" name="search">&nbsp;<input type="submit" value="Search"></form></td></tr>
    <tr><td align="center" valign="top"><h1>View Disciplinary Records</h1></td></tr>
    <tr><td align="center" valign="top"></td></tr>

    <tr><td align="center" valign="top">
    <?= $html ?></td></tr></table></td></tr></table>
    </body>

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    What is your question / problem?

    Please put PHP code in between [PHP] and [/PHP] tags.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •