Search the Community
Showing results for tags 'unix'.
-
Hi, I'm stuck on below, I have a table called History that records date and time as timestamp, example attached below I'm trying to count the number of entries with todays date, below is the php for todays date and the query, Any one help point me in the write direction. $d=strtotime("today"); $wholedate = date("Y-m-d", $d); $date_array = explode('-', $wholedate); $date = mktime(0,0,0,(int)$date_array[1],(int)$date_array[2],(int)$date_array[0]); $query_rsWorkedToday = "SELECT COUNT(*) FROM history WHERE history_date = ‘$date’”;
- 7 replies
-
- select count
- date
-
(and 1 more)
Tagged with:
-
Hello, I have one "tar.Z" file. Objective is to unzip it by shell script and check the date. File archive: filename_20140103_1540.tar.Z #!/bin/bash cd $REP_DATAS/path u=$(date +%u) if [ ${u} -eq 1 ] ; then dateQ=`date --date='-3 day' +'%Y%m%d_%H%m'` else dateQ=`date --date='-1 day' +'%Y%m%d_%H%m'` fi tar xvf filename_"dateQ".tar.Z THANKS IN ADVANCED.
-
Im trying to create a repeated list of all the years forms have been filled in, in my database. The database has been running for 4 years and the row creation_date is unixtime. I want a list that looks as follows 2010 2011 2012 2013 to create this list I understand Im after creation_date between the highest and lowest value of Year in unixtime. So I wrote the following query mysql_select_db($database_dbconnet, $dbconnet); $query_rs_frmyear = sprintf("SELECT creation_date FROM customer_details WHEREcreation BETWEEEN (SELECT MIN(DATE_FORMAT(FROM_UNIXTIME(creation_date), 'Y')) AS lowyear FROM customer_details)AND (SELECT MAX(DATE_FORMAT(FROM_UNIXTIME(creation_date), 'Y')) AS highyear FROM customer_details)"); $rs_frmyear = mysql_query($query_rs_frmyear, $dbconnet) or die(mysql_error()); //echo the yearsdo {echo $row_rs_frmyear['creation_date']; } while($row_rs_frmyear = mysql_fetch_assoc($rs_frmyear)); Which fell flat on its face!!! Any ideas anyone?