nl2br, new line to br

I just forget this function when my friend ask me about strangeness in his data he store in mysql. He has address data in <textarea></textarea>, new line not converted to br as he thing. He just see all the input just store in single line. After search for a while I remember this gold function …

More

php explode() and wordwrap()

Whats the different of explode() and wordwrap() ? Answer : just see this example for explode() <?php $birthday=’1998-12-11′; //we need to split the component to date, month and year $day_parts=explode(‘-‘,$birthday); // we use – as tool to separate, now print $date_component=$day_parts[2]; $month_component=$day_parts[1]; $year_component=$day_parts[0]; ?> Wordwrap will ‘wrapping’ user input, like formatting crazy user who type …

More

101 CodeIgniter Resources

CodeIgniter already attract my attention since version 1.5, we even try to build application based on it. Beside its clear documentation, their user support awesome too. I’ll try to collect every resource that might useful to share with others who want to learn codeigniter. This post will be update regularly as soon as I get …

More

Make lowercase followed by uppercase data

Question : I have table A with field id, name and address. The data in name field seem not consistent, big letter name sometime found in record. How to update that field with uppercase in name field. For example :                  id              name                                       address                  1               FreAKHolicz  wORker            the moon                  2              tHE atMOSFER bluEZ            …

More

Export picture from mysql database to file

[amazonify]032152599X:left[/amazonify] As our data getting mobile and copying picture is annoying for me I decide to save the picture in the database (mysql). Another challenge came when other division need the data exported in a directory with same dimension (135 x 180 pixel). Structure for table ‘student_pic’  : CREATE TABLE `student_pic` (   `image_id` int(10) …

More