Friday, October 5, 2012

“Got a packet bigger than ‘max_allowed_packet’ bytes” MySQL error



Also, change the my.cnf or my.ini file under the mysqld section and set max_allowed_packet=100M or you could run these commands in a MySQL console connected to that same server:

# mysql -u admin -p

mysql> set global net_buffer_length=1000000;

Query OK, 0 rows affected (0.00 sec)



mysql> set global max_allowed_packet=1000000000;

Query OK, 0 rows affected (0.00 sec)

MSQL Restoring a Table table script


MSQL Restoring a Table table script


To restore your table, you’d run:

$ mysql -u user -ppassword mydb < /tmp/extracted_table.sql

Voila! – you’re back in business.

MYSQL GRANT ALL PRIVILEGES


MYSQL GRANT ALL PRIVILEGES

GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'localhost' IDENTIFIED BY 'password';

Wednesday, October 3, 2012

Tuesday, October 2, 2012

CodeIgniter echo sql statment

CodeIgniter echo sql statment

echo $this->model_name->connectionname->last_query();

Saturday, September 22, 2012

Classification Essay Tips

Division & Classification Essay Tips



Below are classification essay techniques to remember while making classification essay outline.

  • After extensive reading and gathering data, you must underline the important points and highlight them and sort out the things with same characteristics and name it as a separate group.
  • Start the classification essay with an interesting introduction and it should be quite straightforward in such a way that only the main division and classification essay idea or topic continues to be discussed. The introduction states the division and classification essay thesis statement of classification essay titles.
  • The developing paragraphs define each type of the category of the thing or place which is being classified in the classification and division essay topics. It is advisable to discuss only one category in one paragraph. You can also go from small to big category.
  • Provide a clear description of the category through relevant examples.
  • Conclusion is to summing up the essay's main points or providing a final view point about the topic.Conclusion leaves a final impact on reader's mind and it is written in three or four convincing sentences.

Tuesday, September 4, 2012

PHP multidimensional arrays with recursive function


in_array() does not work on multidimensional arrays. You could write a recursive function to do that for you:
function in_array_r($needle, $haystack, $strict = true) {
    foreach ($haystack as $item) {
        if (($strict ? $item === $needle : $item == $needle) ||  
(is_array($item) && in_array_r($needle, $item, $strict))) {
            return true;
        }
    }

    return false;
}

Usage:

$b = array(array("Mac", "NT"), array("Irix", "Linux"));
echo in_array_r("Irix", $b) ? 'found' : 'not found';