SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Execute procedure

    Hi, I am a student and was given a task to provide the lines of PHP code used to execute a procedure in a MySQL database.

    I am very very weak in PHP, to be honest, I don't know what does the codes mean. Need help from anyone here, please!!

    The codes given are as below:

    DROP PROCEDURE IF EXISTS `a1`.`sp_archive`$$

    CREATE PROCEDURE `a1`.`sp_archive` ()
    BEGIN
    DELETE FROM users WHERE last_login < DATE_ADD(sysdate(), INTERVAL -1 YEAR);
    END$$


    Thanks!!

  2. #2
    SitePoint Addict
    Join Date
    Nov 2008
    Location
    Peterborough, Ontario, Canada
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isn't PHP. This is SQL for making changes to a database. Your assignment is likely that you need to reproduce the same effects using PHP. You should find an introductory tutorial for PHP and MySQL -- within 30 minutes you should be able to answer the question -- and you'll be able to some very cool things with websites.

    A good starting point is: http://www.tizag.com/mysqlTutorial/mysqlconnection.php
    Have I helped you? You could help me.
    Like my business on facebook!
    Text message polls with real-time, live results.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Location
    Dubrovnik, Croatia
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That query deletes all users from 'users' table if they last login is from current system date to -1 year.


Bookmarks

Posting Permissions

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