예제 #1
0
파일: AnswerDB.php 프로젝트: phucps89/Tour
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     ini_set('max_execution_time', 0);
     $data = DB::select('select * from option_ans');
     $insert = [];
     foreach ($data as $d) {
         $insert[] = ['id' => $d->id, 'name' => $d->opt_content];
     }
     Answer::insert($insert);
 }
예제 #2
0
<?php

require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
require_once "answer.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/jfindley2.ini");
$answer = new Answer(null, 1, 2, "The answer", null);
$answer->insert($pdo);
$answer->setAnswerText("A better answer");
$answer->update($pdo);
$answer->delete($pdo);