예제 #1
0
                 echo "seed successful\n";
                 echo $database->thisConnection()->error;
             }
         }
     } else {
         $query = file_get_contents($config['sql_file']);
         if ($database->thisConnection()->multi_query($query)) {
             echo "migrate success\n";
         } else {
             echo "migrate fail\n";
             echo $database->thisConnection()->error;
         }
     }
     break;
 case 'insert':
     $query = $database->buildInsertQuery($commandLine->getTable(), $commandLine->parseWithoutEquals(0));
     if ($database->thisConnection()->query($query)) {
         echo "Insert Succeeded.\n";
     } else {
         echo "Insert failed.  Make sure your parameters are correct and you have needed foreign keys available.\n";
     }
     break;
 case 'update':
     $query = $database->buildUpdateQuery($commandLine->getTable(), $commandLine->parseWithEquals(1), $commandLine->parseWithEquals(0, " AND "));
     if ($database->thisConnection()->query($query)) {
         echo "Update Succeeded.\n";
     } else {
         echo "Update failed.  Make sure your parameters are correct and you have needed foreign keys available.\n";
     }
     break;
 case 'delete':