User Profile

Collapse

Profile Sidebar

Collapse
lptl
lptl
Last Activity: Mar 10 '08, 12:44 AM
Joined: Feb 25 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • lptl
    replied to Subtract/Add to date to get a usable variable
    in PHP
    Yep, I understand the SQL stores the date in YYYY-MM-DD format. The userDateExpire is the data type DATE with default value of 0000-00-00. Dates manually entered into the database in the userDateExpire column are entered in the format YYYY-MM-DD.
    Code:
    $query = "SELECT *, DATE_FORMAT(userDateExpire, '%m-%d-%Y') AS userDateExpire FROM users WHERE DATEDIFF('userDateExpire','sql_date') < 700 ORDER BY userLastName";
    In the above...
    See more | Go to post

    Leave a comment:


  • lptl
    replied to Subtract/Add to date to get a usable variable
    in PHP
    I think this is what you asked for. Within PHP this is how I call to my db and pull data to display on the web:
    Code:
    <?php include '../config.php'; 
    $query = "SELECT user_id, userFirstName, userMiddleInitial, userLastName FROM users ORDER BY userLastName"; 
    $result = mysql_query($query) or die('Error, select query failed');				
    $row = mysql_fetch_array($result, MYSQL_ASSOC)
    ?>
    Then when displaying...
    See more | Go to post

    Leave a comment:


  • lptl
    replied to Subtract/Add to date to get a usable variable
    in PHP
    Thank you for the quick response!
    I'm trying to run the query inside MySQL but I'm having trouble. I tried using other numbers (assuming that 100 = 1 month if I read correctly) and the opposite sign > and it keeps returning:

    MySQL returned an empty result set (i.e. zero rows). (Query took 0.0010 sec)

    when I try to run it using phpMyadmin. There is 5 rows of user data with dates in the column i'm trying to use....
    See more | Go to post

    Leave a comment:


  • lptl
    started a topic Subtract/Add to date to get a usable variable
    in PHP

    Subtract/Add to date to get a usable variable

    I know the title is misleading. I am working on a class project where we are trying to setup a notification system written in PHP and using an MySQL database. We are trying to set-up a notification page that will show what users are nearing expiration. The expiration dates are entered in manually and are not a timestamp. The dates are entered in on another page into the SQL database. Then what we need is to be able to take those dates and find that...
    See more | Go to post
No activity results to display
Show More
Working...