Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
12-05-2013, 10:37 AM #1
- Join Date
- Oct 2013
- 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.
from mydb import cursor
cam_name = sys.argv
rec_date = sys.argv
print "Usage: %s cam_name date " % sys.argv
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" """ % (tablename, rec_date)
retval = cursor.fetchall()
for values in retval:
(vrm, vrm_datetime, record_id) = values
dbObj.reconcile_plate(cam_name, vrm, vrm_datetime, record_id)
12-05-2013, 01:22 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 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.
Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');