Saturday, November 23, 2013

laravel pdo load data infile only imports first row."This command is not supported in the prepared statement protocol yet"

"This command is not supported in the prepared statement protocol yet". When I tried to use "load data infile" as a raw query on a table , It failed with this error , and after playing with many parameters in the query and tried many DB methods like DB::raw,DB::statement and DB::select, but nothing change the problem still exist . finally I can run the query but only the first raw was inserted,so The problem is in the query itself and Mysql server cannot under the end of line symbol , Just adding double back slash will solve this issue.
"LOAD DATA LOCAL INFILE 'filename'

                    INTO TABLE `tablename`

                    FIELDS TERMINATED BY ','

                    LINES TERMINATED BY '\\n'

                    (col1,col2,col3)";

Thursday, November 21, 2013

laravel 4 Cannot modify header information - headers already sent by (output started at

This error happened when you are using one of these statements in laravel 4 application :

 Redirect::to or  header('Location: ' . $url) 

Where your Laravel 4 application had sent a header to the screen before you decide to redirect the browser to other url . Sometimes this error caused by echo statement before the redirection , other output text or white space, But in my case the error because I have added a php closed tag:

?>  

in the end of the included files. So removing  this tag will bring the application back to normal behavior.

Tuesday, November 12, 2013

User is not returning back after been sent to oauth/authenticate on twitter api 1.1

When you trying to connect with twitter api 1.1 to authenticate a user , some time the twitter Authentication page will not come back to the callback function And you are very sure that the required parameters are valid and set .The first thing you should do is trying the code with another new client (Screen name), a client that was never subscribed to the application. if the new client can authenticate and return back to the application then the Problem is in the Permission levels of your application with twitter api, and to solve this issue then, every subscribed user should revoke the application and subscribe to it again.

Sunday, November 10, 2013

ie html contditional tage is not responding when using ie conditions

If you have a problem that ie tag is not working and the css file that you assign for this tag is not loading then the problem may be as I found it in the tag spaces. there must be no space in the tag before "If" and after ie9 .like what you see here :

<!--[if lt IE9]>
    <link rel="stylesheet" type="text/css" href="/assets/css/ie.css" />
<![endif]-->


 that mistake can happened if it like the following:

<!--  [if lt IE9]> or <!--[if lt IE 9]> or  <!--[if lt IE 9]  > 

also

<!  [endif]-->  or <![endif]  --> 
 
 
Note: Microsoft Stopped supporting IE condition tag in IE-10 and later Versions