Jump to content

Barand

Moderators
  • Posts

    24,563
  • Joined

  • Last visited

  • Days Won

    822

Everything posted by Barand

  1. VB! I should report this post for use of offensive language
  2. http://stackoverflow.com/questions/565997/in-mysql-what-does-overhead-mean-what-is-bad-about-it-and-how-to-fix-it
  3. Did you try #11?
  4. http://mh-nexus.de/en/hxd/
  5. Name all the checkboxes with name='agree[]' They are then posted as an array And, yes, without values they are useless
  6. I was referring to the first query and it was a caveat if following B_CooperA's suggestion
  7. As you can see below, it is pretty lenient when it comes to format mysql> SELECT strdate, STR_TO_DATE(strdate, '%d/%m/%Y') FROM datetest; +------------+----------------------------------+ | strdate | STR_TO_DATE(strdate, '%d/%m/%Y') | +------------+----------------------------------+ | 20/08/2012 | 2012-08-20 | | 20/8/2012 | 2012-08-20 | | 2/8/12 | 2012-08-02 | +------------+----------------------------------+ Find the ones that won't convert with SELECT * FROM mytable WHERE STR_TO_DATE(olddate, '%d/%m/%Y')) IS NULL OR STR_TO_DATE(olddate, '%d/%m/%Y')) = '0000-00-00' OR STR_TO_DATE(olddate, '%d/%m/%Y')) = '1970-01-01'
  8. Alternative method using divs instead of table http://forums.phpfreaks.com/topic/282474-i-want-to-create-thumbnail-but-facing-problems/?do=findComment&comment=1451471
  9. Just make sure you call it once right at the top of each script that uses session variables
  10. So that gives you 10 hours to do the CSS, 10 pages and installation without any contingency for the client to change their mind (and that's not exactly unheard of) and there are always "just jobs". You know the sort of thing - as my wife says "if you could just knock down that internal wall..." I suspect you could end up working for minimum wage (approx 7GBP/10USD in the UK)
  11. Alternatively, if the options are coming from a database table, change the query so those with blank values are exluded.
  12. with the parentheses you have (A OR B) AND C AND D without, you will effectively have A OR (B AND C AND D)
  13. Forget that last feeble effort of mine, try this one instead echo "\t\tfor(index=0; index < $maxclothrows; index++)\n"; echo "\t\t{\n"; echo "\t\t\tif (document.pickDivision.cloth.options[index].text == '')\n"; echo "\t\t\t\tdocument.pickDivision.cloth.options[index]=null;\n"; echo "\t\t}\n\n";
  14. Try checking fo null instead of empty string echo "\t\tfor(index=0; index < $maxclothrows; index++)\n"; echo "\t\t\if(document.pickDivision.cloth.options[index].text != null)\n"; // <-------------- change echo "\t\t{\n"; echo "\t\t\tdocument.pickDivision.cloth.options[index].text = '';\n"; echo "\t\t\tdocument.pickDivision.cloth.options[index].value = '';\n"; echo "\t\t}\n\n";
  15. echo "\t\tfor(index=0; index < $maxclothrows; index++)\n"; echo "\t\t\if(document.pickDivision.cloth.options[index].text != '')\n"; // <-------------- add echo "\t\t{\n"; echo "\t\t\tdocument.pickDivision.cloth.options[index].text = '';\n"; echo "\t\t\tdocument.pickDivision.cloth.options[index].value = '';\n"; echo "\t\t}\n\n";
  16. Not surprising - that is hardly a valid piece of image creation code. There is no imagecreate() and no imagejpeg()
  17. Format the date or timestamp when you extract from the table to the spreadsheet SELECT DATE_FORMAT(mydatecol, '%m/%d/%y') as pretty_date FROM mytable
  18. You should store dates in Y-m-d format. As you want the current date the easiest way is to use a TIMESTAMP type column then you can forget about it in your insert query as it will auto-update. Alternatively you can put CURDATE() in your insert query and use DATE type column. The reason you get the result you do is that your date wasn't in single quotes so it took it to be 10 / 8 / 13 (ten divided by eight divided by thirteeen)
  19. Don't forget to call image_destroy($thumb); image_destroy($source); after @ImageJpeg($thumb) to release the memory.
  20. jazzman, Why would you want to DATE_FORMAT() to Y-m-d on a date that is already in Y-m-d format? mysql> SELECT STR_TO_DATE('20/08/2012', '%d/%m/%Y'); +---------------------------------------+ | STR_TO_DATE('20/08/2012', '%d/%m/%Y') | +---------------------------------------+ | 2012-08-20 | +---------------------------------------+
  21. The magic incantation you require is STR_TO_DATE() function UPDATE mytable SET newdate = STR_TO_DATE(olddate, '%d/%m/%Y')
  22. If you do this while($rows = mysql_fetch_array($trans)) { $transdate = $rows[transactiondate]; $part = $rows[particulars]; $payee = $rows[payeeid]; $receive = $rows[receiveid]; $dep = $rows[depositac]; $deb = $rows[debitac]; $paystat = $rows[paymentstat]; } then the contents of the variables get overwritten each time you read the next row so you are only left with whatever was in the last row. The output needs to be inside the loop. while($rows = mysql_fetch_array($trans)) { $transdate = $rows[transactiondate]; $part = $rows[particulars]; $payee = $rows[payeeid]; $receive = $rows[receiveid]; $dep = $rows[depositac]; $deb = $rows[debitac]; $paystat = $rows[paymentstat]; // output the data from the row }
  23. ... or in a file referenced by the code
  24. In the object mode you are calling a method of the result object itself so you don't have to tell it what the object is. In procedural mode you have to pass the result object to the function
×
×
  • 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.