
JakeSilver
Members-
Posts
35 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
JakeSilver's Achievements

Member (2/5)
0
Reputation
-
Thankyou so much! I really appreciate that! works like a treat!
-
Surely someone must have created something like this before?
-
I have found this function. function get_months($date1, $date2) { $time1 = strtotime($date1); $time2 = strtotime($date2); $my = date('mY', $time2); $months = array(date('F', $time1)); $f = ''; while($time1 < $time2) { $time1 = strtotime((date('Y-m-d', $time1).' +15days')); if(date('F', $time1) != $f) { $f = date('F', $time1); if(date('mY', $time1) != $my && ($time1 < $time2)) $months[] = date('F', $time1); } } $months[] = date('F', $time2); return $months; } and also included: $first=date('Y-m-d',$datefetch->date); $last=date('Y-m-d',$datemonthlow->date); print_r(get_months('$first', '$last')); however this displays the following "Array ( [0] => January [1] => January ) " and doesn't display the actual months? Any ideas why?
-
Hi There, Im am trying to creat a little script that displays the months/years of 12 months previous to a specific unix time code. I am having real difficulty trying to figure out the logic. For example say there is a unix time code of 1226102400 or (11 November 2008) I would like it to display the following:- 2007 November October September August July June May April March Febuary January 2008 December November Obviously depending on the UNIX tim code depends on the months/years that are displayed. I have the following code at the moment: $curmonth achived from the unix time code. $curmonth=date("m", $f->date); if($curmonth > $lowmonth){ echo "$months[$curmonth]<br>"; echo $lowmonth; $lowmonth == $curmonth; echo $lowmonth; Can anyone help or offer a solution to my problem. I am aware that the code i have created is rubbish and is no where near able to do the job. Any help would be greatfully apprciated. Jake
-
Hi There, I have the following code; $day=$_POST['day']; $month=$_POST['month']; $year=$_POST['year']; echo $day; echo $month; echo $year; $date = mktime(0, 0, 0, $month, $day, $year); When i enter in the date = 12/12/2008 the timestamp i recieve is: 20081030113947 when i should be :1229040000 Why is it doing this? Many Thanks,
-
Thanks Solon & GingerRoot Problem solved!
-
The first query I have done $productListQuery = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE .$like ORDER BY date ASC"; Second query i have done $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE sale_price > 0 ORDER BY ".$glob['dbprefix']."CubeCart_inventory.date ASC"; Its the last of the three. I have tried eveything and keep getting the error Parse error: syntax error, unexpected T_STRING in /home/adrian/public_html/shop/includes/content/viewCat.inc.php on line 162 Line 162 is below: $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']) ORDER BY ".$glob['dbprefix']."CubeCart_Inventory.date ASC; Solon :- I have tried your query and recieve the following error
-
Hi There, I am trying to edit a script so that i can order it by date. I know its a cubecart script but Mods plese dont move as its a problem with a query and i really need it fixed ASAP. Thanks The code is as follows: $productListQuery = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE .$like"; } elseif($_GET['catId']=="saleItems" && $config['saleMode']>0) { $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE sale_price > 0 GROUP BY ".$glob['dbprefix']."CubeCart_inventory.productId"; } else { $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']); } Basically how can i add ORDER BY `date` ASC into each of the 3 instances of the query? As i have had difficulty figureing it out. Many Thanks
-
Hi There, I am trying to edit a cubecart script to order it by date. I know its a third party script but i think its more suitable in this section. The code is as follows: $productListQuery = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE .$like"; } elseif($_GET['catId']=="saleItems" && $config['saleMode']>0) { $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE sale_price > 0 GROUP BY ".$glob['dbprefix']."CubeCart_inventory.productId"; } else { $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']); } Basically how can i add ORDER BY `date` ASC into each of the 3 instances of the query? As i have had difficulty figureing it out. Many Thanks
-
Solved: $stamp = mktime(hour, minute, second, month, day, year);
-
Hi there, I need to convert date in the form of DD:MM:YYYY into a unix time code so i can search with it against the time codes in the database. Is there a function that i can do to do this? Many thanks Jake
-
[SOLVED] Cutting the characters displayed (MySQL)
JakeSilver replied to JakeSilver's topic in PHP Coding Help
ohhh Thanks guys! lots of differnt options then Problem Solved! -
Hello There! I am making a small blog site for myself and instead of downloading packages i want to make it myself. I am wondering if there is a way to cut the number of words displayed.. For example, In blogs you usually have about 20 or 30 words displayed and then a link that says "Read More" Is it the query that cuts it to 30 words? Or is it a function? Can anyone shead some light on this please! Many Thanks, Jake
-
Thankyou Greatly