-
Posts
24,563 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
VB! I should report this post for use of offensive language
-
Can Somebody Tell Me What 'Overhead' Is In My SQL Database?
Barand replied to ben_1uk's topic in MySQL Help
http://stackoverflow.com/questions/565997/in-mysql-what-does-overhead-mean-what-is-bad-about-it-and-how-to-fix-it -
trying to remove blank lines generated in my program
Barand replied to reptile's topic in PHP Coding Help
Did you try #11? -
http://mh-nexus.de/en/hxd/
-
array_chunk()
-
I was referring to the first query and it was a caveat if following B_CooperA's suggestion
-
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'
-
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
-
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)
-
trying to remove blank lines generated in my program
Barand replied to reptile's topic in PHP Coding Help
Alternatively, if the options are coming from a database table, change the query so those with blank values are exluded. -
with the parentheses you have (A OR B) AND C AND D without, you will effectively have A OR (B AND C AND D)
-
trying to remove blank lines generated in my program
Barand replied to reptile's topic in PHP Coding Help
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"; -
trying to remove blank lines generated in my program
Barand replied to reptile's topic in PHP Coding Help
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"; -
trying to remove blank lines generated in my program
Barand replied to reptile's topic in PHP Coding Help
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"; -
Not surprising - that is hardly a valid piece of image creation code. There is no imagecreate() and no imagejpeg()
-
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
-
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)
-
Don't forget to call image_destroy($thumb); image_destroy($source); after @ImageJpeg($thumb) to release the memory.
-
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 | +---------------------------------------+
-
The magic incantation you require is STR_TO_DATE() function UPDATE mytable SET newdate = STR_TO_DATE(olddate, '%d/%m/%Y')
-
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 }
-
... or in a file referenced by the code
-
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