CakePHP: Validate dependent field (select dropdown + input field)

Posted July 15th, 2010 in CakePHP, PHP, Programming, Projects by Louie Miranda

Earlier this week, I was working on a project where I needed to validate two dependent fields.

< ?php echo input('office', array('type' => 'select', 'options' => $nd[0])); ?>
< ?php echo input('office_other', array('maxlength' => '255', 'size' => '35', 'label' => 'Other Office')); ?>

The “office” field is a select (drop down box) from my data array(). What I needed is to be able to add another data from a field and name it as “office_other” where it would initially capture and re-list again new offices if it does not exist.

Continue Reading »

Data Lost *&$@!~%^^*&&^$$*(89^%%%^

Posted May 10th, 2005 in Database, Hardware, MySQL, Programming by Louie Miranda

OH MY GO****, &^%%$$#!@$&amp;*(&*^, I just accidentally deleted my JobTracker Database. FU***** thats two weeks of work, and all along I knew I had included it on my daily SQL backup.

I figured when I checked my script. It was not there. :/

However, my life was saved when I remembered that I use to send a daily report every afternoon via Email. But, it will really take time to write all those stuffs again.

Im going to find a way.. :(

MySQL, Insert Select

Posted May 8th, 2005 in MySQL, PHP, Programming by Louie Miranda

I been working with a PHP function on how I can duplicate an entry on sql. My first approach was to use the while() function, but what it does was loop the entire process.

I posted at phpugph.com and ask them what they think, and they suggested the INSERT – SELECT of MySQL.

1
2
3
mysql> INSERT INTO jt_entry (uid,entry_requested_by,entry_status,entry_category,entry_title,entry_description)
select uid, entry_requested_by, entry_status, entry_category, entry_title, entry_description from jt_entry
where entry_id=3limit 1;

Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0

Thanks!

buddyicon from flickr, a TEST

Posted March 23rd, 2005 in Personal, Technology by Louie Miranda

buddyicon
Originally uploaded by axishift.

I am testing my account on flickr, im trying to upload some photos directly on that site. :)