Search This Blog

Friday, September 26, 2014

Cannot modify header information - headers already sent by

Facing error when try to use codeigniter and the page won't redirect after update / edit

 A PHP Error was encountered

    Severity: Warning

    Message: Cannot modify header information - headers already sent by (output started at xxxxx:1)

    Filename: libraries/Session.php

    Line Number: 675
 A PHP Error was encountered

    Severity: Warning

    Message: Cannot modify header information - headers already sent by (output started at xxxxx:1)

    Filename: helpers/url_helper.php

    Line Number: 542

How to solve my issue?

open index.php and add ob_start();  like below

ob_start();

/*
 *---------------------------------------------------------------
 * APPLICATION ENVIRONMENT
 *---------------------------------------------------------------
 *
 * You can load different configurations depending on your
 * current environment. Setting the environment also influences
 * things like logging and error reporting.
 *
 * This can be set to anything, but default usage is:
 *
 *     development
 *     testing
 *     production
 *
 * NOTE: If you change these, also change the error_reporting() code below
 *
 */

Thursday, September 4, 2014

duplicate or clone MySQL database table

Many will facing issue when try to duplicate or clone database table in MySQL.
Below is the script and it's tested working well.

New table: tbltransaction_new
Existing table: tbltransaction

CREATE TABLE tbltransaction_new LIKE tbltransaction;
INSERT tbltransaction_new SELECT * FROM tbltransaction;