コード例 #1
0
ファイル: index.php プロジェクト: yanvalue/reusable-wheels
/**
 * 主体思想必须光辉伟大!
 *
 * @return void
 **/
function run()
{
    //删除文件
    deletedir();
    //删除数据库
    deleteDB();
}
コード例 #2
0
<?php

require_once '../config.php';
checkAjax();
$return_data = array('status' => 0);
$id = secure_data($_POST['id']);
$table = secure_data($_POST['tbl']);
$allowed_tables = array('courses', 'course_sections');
if ($id && $table && in_array($table, $allowed_tables)) {
    deleteDB($table, $id);
    $return_data['status'] = 1;
    $return_data['message'] = 'Record deleted successfully.';
}
echo json_encode($return_data);
exit;
コード例 #3
0
ファイル: admin.php プロジェクト: Podbe/Podbe_V4-firtz-node
function get_adminpageDeletePodcast($delete_id, $admin_url)
{
    //lese DB aus
    $db = schalterDB(true);
    //lösche einen Eintrag
    deleteDB($db, $delete_id);
    //mache weiterleitung
    header("location: " . $admin_url . "?intern=updatepage");
}
コード例 #4
0
<?php

require_once 'config.php';
checkAjax();
$return_data = array('status' => 0);
$id = secure_data($_POST['id']);
if ($id) {
    deleteDB('users', $id);
    $return_data['status'] = 1;
    $return_data['message'] = 'User deleted successfully.';
}
echo json_encode($return_data);
exit;
コード例 #5
0
<?php

require_once '../config.php';
checkAjax();
$return_data = array('status' => 0);
$id = secure_data($_POST['section_id']);
if ($id) {
    deleteDB('course_sections', $id);
    $return_data['id'] = $id;
    $return_data['status'] = 1;
    $return_data['message'] = 'Record deleted successfully.';
}
echo json_encode($return_data);
exit;
コード例 #6
0
ファイル: db_utils.php プロジェクト: rsouflaki/TodoList
<?php

define('SQL_HOST', 'localhost');
define('SQL_USER', 'root');
define('SQL_PASS', 'pasok');
define('SQL_DB', 'todo_db');
$conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die('Could not connect to the database; ' . mysql_error());
if (isset($_GET['action'])) {
    echo 'Processing action: ' . $_GET['action'];
    echo '</br>';
    switch ($_GET['action']) {
        case 'create':
            createDB(SQL_DB, $conn);
            break;
        case 'delete':
            deleteDB(SQL_DB, $conn);
            break;
        case 'tables':
            createTables(SQL_DB, $conn);
            break;
        case 'drop':
            dropTables(SQL_DB, $conn);
            break;
        case 'data':
            insertTestDataSet(SQL_DB, $conn);
            break;
    }
}
function createDB($dbName, $conn)
{
    $sql = <<<EOS
コード例 #7
0
ファイル: index.php プロジェクト: cyberwani/Snippets-1
            echo $importResult;
        }
        // display the tables on screen so we can see they were dumped
        if ($tables = getTableList($connection, $config["db"]["name"])) {
            foreach ($tables as $id => $table) {
                printTable($connection, $table);
            }
        } else {
            echo "<br><br>No tables found.<br><br>";
        }
    } else {
        echo "Error selecting database: " . mysql_error();
    }
} else {
    // drop the database
    deleteDB($connection, $config["db"]["name"]);
}
// disconnect from db server
mysql_close($connection);
// dump the output buffer
$buffer = ob_get_contents();
ob_end_clean();
?>


	<h1>MySQL Helper</h1>
	<p>This script is intended as a package of basic MySQL database functions. When you load this page, it will cycle through and show one of these two alternating states:</p>
	<ul>
		<li>Database roundtrip: Show the existing server environment, create a new database from the contents of <code>db/schema.php</code>, populate it with example data from <code>db/data.php</code>, export it to a flat file, delete all tables, then re-import from the generated flat file.</li>
		<li>Database dump: throwing out the previous database and showing nothing.</li>
	</ul>