Ejemplo n.º 1
0
function baz($x)
{
    updateDb('
        UPDATE quz
        SET y = 1
        Where id >
    ' . $x);
}
Ejemplo n.º 2
0
    $ad = $adStore[$id];
    $formParams = prepareAD($ad);
} else {
    if (isset($_GET['del'])) {
        $id_for_del = $_GET['del'];
        del($id_for_del);
        header('Location: index.php');
    }
    if (isset($_POST['main_form_submit'])) {
        //	всё, что пришло из формы записать в БД
        $uns = isset($adStore) ? $adStore : array();
        $id = isset($_POST['hidden']) ? $_POST['hidden'] : '';
        if (!is_numeric($id)) {
            //добавление нового объявления
            $adStore = prepareAD($_POST);
            postDb($adStore);
        } else {
            $ad_update = $adStore[$id] = prepareAD($_POST);
            // добавление отредактированного объявления
            updateDb($ad_update, $id);
        }
        header('Location: index.php');
    }
}
$for_radios = array(1 => 'Частное лицо', 0 => 'Компания');
$for_radios_checked = $formParams['private'];
$id = isset($id) ? $id : '';
// условие, чтобы не было ошибки после редактирования объявления
$smartyParams = array('formParams' => $formParams, 'adStore' => $adStore, 'id' => $id, 'cities' => $cities, 'categories' => $categories, 'for_radios' => $for_radios, 'for_radios_checked' => $for_radios_checked);
$smarty->assign('smartyParams', $smartyParams);
$smarty->display('mysql_index_for_smarty.tpl');
Ejemplo n.º 3
0
// create database structure
if ($continue) {
    $rollBack = true;
    $step++;
    if ($createDb == 'true') {
        try {
            $db = new RecordSet($dbConnectionInfo, false, true);
            $db->runFile($baseDir0 . "/install/initDb.sql");
            echo "<br/>Tables created.";
        } catch (Exception $ex) {
            echo "<br/>Could not create database structure!";
            echo "<!-- " . $ex->getMessage() . " -->";
            $continue = false;
        }
    } else {
        $continue = updateDb($dbConnectionInfo);
        if (!$continue) {
            $showBtBack = true;
            // 						echo "No database structure has been yet performed!";
        }
    }
    if ($continue) {
        installProduct($dbConnectionInfo);
    }
}
// create administrator user
if ($continue && $createDb == 'true') {
    $step++;
    try {
        $pass = md5($adminPass);
        $db = new RecordSet($dbConnectionInfo, false, true);