MySQLi insert issues
Trying to update a prior working INSERT but not having any errors from the MySQLi Insert behavior to see why it will not work.
Note the uploads an image (works) and then the INSERT redirects as if things went well (no errors) but there is no record created.
Here;s the code that does not work:
<?php require_once('../Connections/minBlog_i.php'); ?>
<?php require_once('../webassist/framework/framework.php'); ?>
<?php require_once('../webassist/framework/library.php'); ?>
<?php require_once("../webassist/file_manipulation/helperphp.php"); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
<?php
$rsType = new WA_MySQLi_RS("rsType",$minBlog_i,0);
$rsType->setQuery("SELECT * FROM tblinvtype WHERE tblinvtype.mid = 2 AND tblinvtype.status = '0' ORDER BY tblinvtype.typeName");
$rsType->execute();
?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../uploadedImg/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "2",
'ResizeWidth' => "800",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "../uploadedImg/",
'FileName' => "thumb_[FileName]",
'DefaultFileName' => "",
'ResizeType' => "2",
'ResizeWidth' => "350",
'ResizeHeight' => "",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1_3 Start
$WA_UploadResult1_Params["WA_UploadResult1_3"] = array(
'UploadFolder' => "../uploadedImg/small/",
'FileName' => "_thumb2[FileName]",
'DefaultFileName' => "",
'ResizeType' => "2",
'ResizeWidth' => "220",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_3 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "imageUp", "0", "", "true", $WA_UploadResult1_Params);
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$InsertQuery = new WA_MySQLi_Query($minBlog_i);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "test";
$InsertQuery->bindColumn("field", "s", "".((isset($_POST["Title"]))?$_POST["Title"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("fieldtwo", "s", "".((isset($_POST["event"]))?$_POST["event"]:"") ."", "WA_DEFAULT");
$InsertQuery->saveInSession("sess_news");
$InsertQuery->execute();
$InsertGoTo = "main.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
Here's a test page that DOES work and inserts into a test table:
<?php require_once('../Connections/minBlog_i.php'); ?>
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$InsertQuery = new WA_MySQLi_Query($minBlog_i);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "test";
$InsertQuery->bindColumn("field", "s", "".((isset($_POST["fld1"]))?$_POST["fld1"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("fieldtwo", "s", "".((isset($_POST["fld2"]))?$_POST["fld2"]:"") ."", "WA_DEFAULT");
$InsertQuery->saveInSession("sestest");
$InsertQuery->execute();
$InsertGoTo = "main.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
Any ideas on what could be wrong or tools / examples to echo the Insert query?