close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

mysqli update recordset not working

Thread began 1/23/2018 9:04 am by Ashok | Last modified 1/25/2018 1:00 pm by Ashok | 105 views | 4 replies

Ashok

mysqli update recordset not working

Hello,

It seems I am making some silly mistake that I am unable to catch.
The update behavior is not working. No errors.

<?php require_once('../Connections/bimpra.php'); ?>
<?php require_once("../webassist/ckeditor/ckeditor.php"); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php require_once("../webassist/file_manipulation/helperphp.php"); ?>
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php
if ("" == "") {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "user";
$RestricAccessRedirect = "login.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
?>
<?php

$user = new WA_MySQLi_RS("user",$bimpra,0);
$user->setQuery("SELECT * FROM users");
$user->execute();?>
<?php
$blogcity = new WA_MySQLi_RS("blogcity",$bimpra,0);
$blogcity->setQuery("SELECT * FROM blog_city");
$blogcity->execute();?>
<?php
$blogarticle = new WA_MySQLi_RS("blogarticle",$bimpra,1);
$blogarticle->setQuery("SELECT * FROM blog_article WHERE id = ?");
$blogarticle->bindParam("i", "".(isset($_GET['id'])?$_GET['id']:"") ."", "-1"); //colname
$blogarticle->execute();?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../file/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "570",
'ResizeHeight' => "370",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End?>
<?php
// WA_UploadResult2 Params Start
$WA_UploadResult2_Params = array();
// WA_UploadResult2_1 Start
$WA_UploadResult2_Params["WA_UploadResult2_1"] = array(
'UploadFolder' => "../file/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "870",
'ResizeHeight' => "420",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "pic1", "0", "", "true", $WA_UploadResult1_Params);
}?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult2", "pic2", "0", "", "true", $WA_UploadResult2_Params);
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$UpdateQuery = new WA_MySQLi_Query($bimpra);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "blog_article";
$UpdateQuery->bindColumn("city", "s", "".((isset($_POST["city"]))?$_POST["city"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("metatitle", "s", "".((isset($_POST["metatitle"]))?$_POST["metatitle"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("metakeywords", "s", "".((isset($_POST["metakeywords"]))?$_POST["metakeywords"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("metadescription", "s", "".((isset($_POST["metadescription"]))?$_POST["metadescription"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("blogtitle", "s", "".((isset($_POST["blogtitle"]))?$_POST["blogtitle"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("translit", "s", "".((isset($_POST["translit"]))?$_POST["translit"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("dateposted", "s", "".((isset($_POST["dateposted"]))?$_POST["dateposted"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("writer", "s", "".((isset($_POST["writer"]))?$_POST["writer"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("article", "s", "".((isset($_POST["article"]))?$_POST["article"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("pic1", "s", "".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("pic2", "s", "".($WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("active", "i", "".((isset($_POST["active"]))?$_POST["active"]:"") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("id", "=", "i", "".($_GET['id']) ."");
$UpdateQuery->execute();
$UpdateGoTo = "blogarticle.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
//var_dump($UpdateQuery);
//die();
?>
<!DOCTYPE html>
<html lang="ru">
<head>

<!-- SITE TITTLE -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Админ Панель - Бимпра</title>

<!-- PLUGINS CSS STYLE -->
<link href="../plugins/jquery-ui.css" rel="stylesheet" type="text/css">
<link href="../plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="../plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../plugins/rs-plugin/css/settings.css" media="screen">
<link rel="stylesheet" type="text/css" href="../plugins/selectbox/select_option1.css">
<link rel="stylesheet" type="text/css" href="../plugins/datepicker/datepicker.css">
<link rel="stylesheet" type="text/css" href="../plugins/isotope/jquery.fancybox.css">
<link rel="stylesheet" type="text/css" href="../plugins/isotope/isotope.css">

<!-- GOOGLE FONT -->
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

<!-- CUSTOM CSS -->
<link href="../css/style.css" rel="stylesheet">
<link rel="stylesheet" href="../css/colors/default.css" id="option_color">

<!-- FAVICON -->
<link rel="shortcut icon" type="image/png" href="../img/favicon.png"/>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<link type="text/css" href="../webassist/datepicker/updatearticle_datepicker_1/jquery-ui.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'dd/mm/yy',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
function closeDatePicker_datepicker_1() {
var tElm = $('#datepicker_1');
if (typeof datepicker_1_Spry != null && typeof datepicker_1_Spry != "undefined" && dateposted_Spry.validate) {
datepicker_1_Spry.validate();
}
tElm.blur();
}
</script>
</head>

<body>
<div class="main-wrapper">

<!-- HEADER -->
<header>
<?php include('nav.php'); ?>
</header>

<!-- PAGE TITLE -->
<section class="pageTitle" style="background-image:url(../img/pages/page-title-bg9.jpg);">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="titleTable">
<div class="titleTableInner">
<div class="pageTitleInfo">
<h1>Админ Панель</h1>
<div class="under-border"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>

<!-- PAGE CONTENT -->
<section class="mainContentSection blogSidebar">
<div class="container">
<div class="row">

<div class="col-sm-12 col-xs-12">
<div class="thumbnail blogSinglePost">
<div class="caption">


<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="POST" role="form" class="form" enctype="multipart/form-data">
<div class="form-group">
<h2>UPDATE BLOG ARTICLE</h2>
</div>
<div class="form-group">
City<select name="city">
<?php
while(!$blogcity->atEnd()) {
?>


<option value="<?php echo($blogcity->getColumnVal("city")); ?>"<?php
if ($blogcity->getColumnVal("city")==$blogarticle->getColumnVal("city") )
echo 'selected="selected"' ;
?>><?php echo($blogcity->getColumnVal("city")); ?></option>


<?php
$blogcity->moveNext();
}
$blogcity->moveFirst(); //return RS to first record
?></select>
</div>
<div class="form-group">
Meta Title<input type="text" class="form-control" id="metatitle" name="metatitle" value="<?php echo($blogarticle->getColumnVal("metatitle")); ?>" >
</div>
<div class="form-group">
Meta Keywords <input type="text" class="form-control" id="metakeywords" name="metakeywords" value="<?php echo($blogarticle->getColumnVal("metakeywords")); ?>" >
</div>
<div class="form-group">
Meta Description <input type="text" class="form-control" id="metadescription" name="metadescription" value="<?php echo($blogarticle->getColumnVal("metadescription")); ?>" >
</div>
<div class="form-group">
Blog Title<input type="text" class="form-control" id="blogtitle" name="blogtitle" value="<?php echo($blogarticle->getColumnVal("blogtitle")); ?>" >
</div>
<div class="form-group">
Translit <input type="text" class="form-control" id="translit" name="translit" value="<?php echo($blogarticle->getColumnVal("translit")); ?>" >
</div>
<div class="form-group">
Date
<input id="datepicker_1" name="dateposted" type="text" />
</div>
<div class="form-group">
Author <input type="text" class="form-control" id="writer" name="writer" value="<?php echo($blogarticle->getColumnVal("writer")); ?>" >
</div>
<div class="form-group"> Article
<?php
// The initial value to be displayed in the editor.
$CKEditor_initialValue = "".($blogarticle->getColumnVal("article")) ."";
$CKEditor = new CKEditor();
$CKEditor->basePath = "../webassist/ckeditor/";
$CKEditor_config = array();
$CKEditor_config["wa_preset_name"] = "No File Management";
$CKEditor_config["wa_preset_file"] = "NoFileManagement.xml";
$CKEditor_config["width"] = "100%";
$CKEditor_config["height"] = "200px";
$CKEditor_config["dialog_startupFocusTab"] = false;
$CKEditor_config["fullPage"] = false;
$CKEditor_config["tabSpaces"] = 4;
$CKEditor_config["toolbar"] = array(
array( 'Source','-','Save','NewPage','Preview','-','Templates'),
array( 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'),
array( 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'),
array( 'Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'),
array( 'BidiLtr','BidiRtl'),
('/'),
array( 'Bold','Italic','Underline','Strike','-','Subscript','Superscript'),
array( 'NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'),
array( 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),
array( 'Link','Unlink','Anchor'),
array( 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'),
('/'),
array( 'Styles','Format','Font','FontSize'),
array( 'TextColor','BGColor'),
array( 'Maximize','ShowBlocks','-','About'));
$CKEditor_config["contentsLangDirection"] = "ltr";
$CKEditor_config["entities"] = false;
$CKEditor_config["pasteFromWordRemoveFontStyles"] = false;
$CKEditor_config["pasteFromWordRemoveStyles"] = false;
$CKEditor->editor("article", $CKEditor_initialValue, $CKEditor_config);
?>
</div>
<div class="form-group">
Pic 1 (570px × 370px)
<input name="pic1" type="file"><br>
<img src="../file/<?php echo($blogarticle->getColumnVal("pic1")); ?>" width="100" height="">
</div>
<div class="form-group">
Pic 2(870px × 420px)
<input name="pic2" type="file"><br>
<img src="../file/<?php echo($blogarticle->getColumnVal("pic2")); ?>" width="100" height="">
</div>
<div class="form-group">
Active<input name="active" type="checkbox" value="1" <?php
if ($blogarticle->getColumnVal("active")==1)
echo 'checked="checked"' ;
?> >
</div>

<button type="submit" name="submit" class="btn buttonCustomPrimary">Update Article</button>
</form>



</div>



</div>
</div>
</div>
</div>
</section>

<!-- FOOTER -->
<?php include('footer.php'); ?>

</div>

<!-- JAVASCRIPTS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../plugins/jquery-ui/jquery-ui.js"></script>
<script src="../plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../plugins/rs-plugin/js/jquery.themepunch.tools.min.js"></script>
<script src="../plugins/rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
<script src="../plugins/selectbox/jquery.selectbox-0.1.3.min.js"></script>
<script src="../plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
<script src="../plugins/counter-up/jquery.counterup.min.js"></script>
<script src="../plugins/isotope/isotope.min.js"></script>
<script src="../plugins/isotope/jquery.fancybox.pack.js"></script>
<script src="../plugins/isotope/isotope-triger.js"></script>
<script src="../plugins/countdown/jquery.syotimer.js"></script>
<script src="../js/custom.js"></script>

</body>

</html>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...