[Solved] SQL INSERT VALUES INTO TABLE FROM FILE [closed]

Both your PHP and your MySQL syntax have problems. First, your SQL statement needs to be surrounded by quotes. Secondly, the syntax for LOAD DATA INFILE is incorrect. Try this: $stmt=$db->prepare(“LOAD DATA INFILE ‘insert.txt’ into table `Info`”); $stmt->execute(); See the MySQL docs for LOAD DATA INFILE for more options. You’ll probably need to specify your … Read more

[Solved] Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ‘]’ in C:\Programe\xampplite\xampplite\htdocs\insert.php on line 12 [closed]

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ‘]’ in C:\Programe\xampplite\xampplite\htdocs\insert.php on line 12 [closed] solved Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ‘]’ in C:\Programe\xampplite\xampplite\htdocs\insert.php on line 12 [closed]

[Solved] Using $.post, $.ajax or AJAX properly in CodeIgniter to call a PHP script

Yes, you will need to put your file inside the libraries folder(if the class is separate from codeigniter or is shared among many controllers, if not a Model would suffice), then create a controller for it. class Ajax_Controller extends CI_Controller { public $statusCode = 200; public $response = array(); public function __construct() { parent::__construct(); if(!$this->is_ajax_request()){ … Read more

[Solved] Need a preg_replace or best option for this conversion [closed]

Your question is very unclear and I may be way off, but here is my attempt to your question. $link = array(‘S1, Ep1’, ‘S1, Ep2’, ‘S1, Ep3’, ‘S1, Ep10’); $results = preg_replace_callback(‘~^S(\d+)\D+(\d+)$~m’, function($m) { $which = strlen($m[2]) > 1 ? ’00’ : ‘000’; return $m[1] . $which . $m[2]; }, array_values($link)); print_r($results); Output Array ( … Read more

[Solved] SQL – Insert 1000 values fast [closed]

I don’t know what data base are you using. You can search for “Bulk Insert” for your data base, it allows you to insert complete file in one step. If you need to create an instruction like this: INSERT CodesTable VALUES (91111), (91112), … (91999) You could open/copy&past the file in query editor. Make a … Read more

[Solved] PHP Read lines in blocks in a file

Try this its working <? $file = file(“data.txt”); foreach($file as $key => $value) { $filter_value = trim($value); if($filter_value!=”” && $filter_value!=”—-SMS_START—-” && $filter_value!=”—-SMS_END—-“){ $new_array[] = $value; $my_array = array_chunk($new_array, 7); } } $count = count($my_array); for($I=0;$I<$count;$I++){ foreach($my_array[$I] as $key => $value){ $ss = explode(“:”, $value); $mm_array[$I][$ss[0]] = str_replace($ss[0].”:”, “”, $value); } } echo “<pre>”; print_r($mm_array); echo … Read more