MySQL can be used to do some string replacements rather using any programming languages.
The following is used to replace space with hyphen in list names
UPDATE list SET list_name = REPLACE(list_name, ' ', '-') WHERE list_name LIKE '% %';
sharing some useful programming tips with other developers.
MySQL can be used to do some string replacements rather using any programming languages.
The following is used to replace space with hyphen in list names
UPDATE list SET list_name = REPLACE(list_name, ' ', '-') WHERE list_name LIKE '% %';
User registration form is a good example for this validator. Checking the username exists or not.
Db_NoRecordExists validator helps to achieve this
$username = new Zend_Form_Element_Text('username', array('label' => 'Username', 'required' => true, 'filters' => array('StripTags', 'StringTrim'), 'validators' => array('NotEmpty', array('Db_NoRecordExists',false,array( 'users_table','username_column', 'messages' => array( Zend_Validate_Db_Abstract::ERROR_RECORD_FOUND => '%value% already exists') )))));
If your Putty Connection Manager doesn't load Putty inside the Manager then do this :
1. Go to View -> Connection Manager
2. Right Click in side the right panel -> create a Database ( give any name )
That will create SSH and Telnet folders
3. Right Click on SSH folder and then New -> Connection Manager
4. Add Host Name and select SSH protocol
5. File -> Save All Databases
You are done now.
System commands can be executed from PHP using exec command.
eg:
$out = array(); $command = "memcat --server=10.10.10.10 ITEMS > /tmp/items.txt";The $out variable would hold the output of the command. If there is any issue with executing a command , have the command with path.
exec($command, $out);
eg: $command = "/usr/local/bin/memcat --server=10.10.10.10 ITEMS > /tmp/items.txt";for further info: http://www.php.net/manual/en/function.exec.php
exec($command, $out);
Copyright 2008 Splashpress Media | Converted by eBlog Templates | Blogging Pro Blogger | Designed by Design Disease