Jump to content

JakeSilver

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by JakeSilver

  1. Thankyou so much! I really appreciate that! works like a treat!
  2. Surely someone must have created something like this before?
  3. anyone?
  4. 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?
  5. 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
  6. 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,
  7. Thanks Solon & GingerRoot Problem solved!
  8. 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
  9. 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
  10. 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
  11. Solved: $stamp = mktime(hour, minute, second, month, day, year);
  12. 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
  13. ohhh Thanks guys! lots of differnt options then Problem Solved!
  14. 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
  15. This is a dynamic form and i am not having any luck at all. Im trying to assign a text box to a record in the database. i shall show some code : <?$sectionquery=mysql_query("SELECT * FROM `section` ORDER BY 'id' ASC"); while($data=mysql_fetch_object($sectionquery)){ echo "<p>$data->name<input type='text' value='' name='$data->textcode' size='4'></p> "; } $data->textcode is a ten digit number if ($_POST['Submit']){ $numsec=mysql_query("SELECT * FROM `section` ORDER BY 'id' ASC")or die (mysql_error()); while($secdata=mysql_fetch_object($numsec)){ $boxcode=$secdata->textcode; echo $boxcode; $navvalue= $_POST['$boxcode']; echo" this is nav value $navvalue"; When i echo $boxcode it appears as the same number as $data->textcode which is correct However it does not get the value of the textbox
  16. Hi there, I am having trouble with some text boxes and have given then numerical names? Can textboxes have there names as just numbers? Many Thanks Jake
  17. Mbeals - I have just echoed the query and your right $navvalue has no value which would explain a great deal.. However, I do not know how i am able to retireve the info that is in the textbox any ideas? ag3nt42 - Im sorry if my syntax is lame i taught myself from reading scripts... poorly structured perhaps
  18. I am having trouble getting the info from a automatically created textbox... Basically the text boz is gererated with the name set to its ID.. code is as follows: <?$sectionquery=mysql_query("SELECT * FROM `section` ORDER BY 'id' ASC"); while($data=mysql_fetch_object($sectionquery)){ echo "<p>$data->name<input type='text' value='' name='$data->id' size='4'></p> "; I am retrieving the info int the same way... shown below $numsec=mysql_query("SELECT * FROM `section` ORDER BY 'id' ASC")or die (mysql_error()); while($secdata=mysql_fetch_object($numsec)){ $secid=$secdata->id; $navvalue= $_GET['$secid->id']; mysql_query("UPDATE `thinkweb_advanced`.`section` SET `nav` = '$navvalue' WHERE `section`.`id` =$secid LIMIT 1")or die (mysql_error()); echo "Updated"; However, The info in the textbox is not being added into my database?? any idea? Thanks, Jake
  19. Revaz:- I have just posted the code without the ipanel variable and your right it doesnt show it there either... so therefore the varible appears to be empty.. However at the bottom of the page i echo the varible $pagelink and am given the value of 1 which is correct. I do not understand how this varible is displayed in the page but not in the url?
  20. Included a space after the varible <a href=\"section.php?id=$pagelink &ipanel=" . ($index - $count) . "\"><img src='recent.jpg' id='recent'></a> "; No luck though
  21. I took the & out... but im sure & was used for the "&" And sign.. the code is now as follows print "<a href=\"section.php?id=$pagelink&ipanel=" . ($index - $count) . "\"><img src='recent.jpg' id='recent'></a> "; But again the same problem exsist where it does not display the first variable ("id") how do i go about seperating the variable from the & sign? got any ideas? Thanks
  22. Hi there! I am trying to pass multiple variables in a url as follows print "<a href=\"section.php?id=$pagelink&ipanel=" . ($index - $count) . "\"><img src='recent.jpg' id='recent'></a> "; however the URL is displayed as follows:- ??? http://www.??????.com/section.php?id=&ipanel=5 It shows the varible ipanel easily but does not show the "id=" There is definatly a value in $pagelink as i have echoed it at the bottom of the page and i can see that its value is correct? any solutions? Many thanks Jake
  23. Can't use "IN" as far as im aware "IN" isn't a MySQL Operator
  24. Use "OR" i.e. mysql_query("SELECT * FROM useronline WHERE(file='http://www.runningprofiles.com/members/index.php?page=mainforum') OR (file=' http://www.runningprofiles.com/members/index.php?page=forum&forum=general') OR ('http://www.runningprofiles.com/members/index.php?page=forum&forum=races'") that should work
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.