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
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    how can i pass start date and end date as command line arguments in PHP

    I am trying to transfer data from one table to another using PHP based on date range.can anyone help me.

    PHP Code:
    #!/usr/bin/env python

    import anprint
    import os
    import sys
    import re
    import datetime
    from mydb import cursor

    try:
        
    cam_name sys.argv[1]
        
    rec_date sys.argv[2]
    except:
        print 
    "Usage: %s cam_name date " sys.argv[0]
        
    sys.exit(1)

    dbObj anprint.ExcelDb()

    # Get a list of the plates...
    tablename "customer_1.%s_anpr_vega" cam_name
    sql 
    """SELECT plate, datetime, id FROM %s WHERE DATE(datetime)="%s" """ % (tablenamerec_date)
    cursor.execute(sql)
    retval cursor.fetchall()
    for 
    values in retval:
        print 
    values
        
    (vrmvrm_datetimerecord_id) = values
        dbObj
    .reconcile_plate(cam_namevrmvrm_datetimerecord_id

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This is python, not PHP. Moving to python forum.
    You can use an INSERT. . . SELECT statement as well to eliminate the need to fetch or loop.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Tags for this Thread

    Posting Permissions

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