mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
parent
0c14a7a11c
commit
a980214b57
1 changed files with 13 additions and 3 deletions
|
@ -52,8 +52,18 @@ $mysqli->select_db($_POST['databaseName']);
|
|||
if ($_POST['createTables'] > 0) {
|
||||
// Temporary variable, used to store current query
|
||||
$templine = '';
|
||||
if(empty($lines)){
|
||||
$obj->error = "File Not found {$_POST['systemRootPath']}install/database.sql";
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
// Read in entire file
|
||||
$lines = file("{$_POST['systemRootPath']}install/database.sql");
|
||||
if(empty($lines)){
|
||||
$obj->error = "File is empty {$_POST['systemRootPath']}install/database.sql";
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
// Loop through each line
|
||||
$obj->error = "";
|
||||
foreach ($lines as $line) {
|
||||
|
@ -78,9 +88,9 @@ if ($_POST['createTables'] > 0) {
|
|||
|
||||
$sql = "DELETE FROM users WHERE id = 1 ";
|
||||
if ($mysqli->query($sql) !== TRUE) {
|
||||
//$obj->error = "Error deleting user: " . $mysqli->error;
|
||||
//echo json_encode($obj);
|
||||
//exit;
|
||||
$obj->error = "Error deleting user: " . $mysqli->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue