Jay329
Hi Ray,
I'm experiencing a similar issue. My database is not updating. Please see below. I'm passing the id from another page via URL. I suspect the issue may be the way the form action is setup. Thank you for your help.
<?php require_once('.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php require_once('webassist/mysqli/queryobj.php'); ?>
<?php
$UpdateTicketCount = new WA_MySQLi_RS("UpdateTicketCount",$xxxxxxxxx,1);
$UpdateTicketCount->setQuery("SELECT * FROM TicketCounts WHERE Id = ?");
$UpdateTicketCount->bindParam("i", "".(isset($_GET['Id'])?$_GET['Id']:"") ."", "-1"); //colname
$UpdateTicketCount->execute();
?>
<?php
if (isset($_POST['submit']) || isset($_POST["submit_x"])) {
$UpdateQuery = new WA_MySQLi_Query($xxxxxxx);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "TicketCounts";
$UpdateQuery->bindColumn("Artist", "s", "".($UpdateTicketCount->getColumnVal("Artist")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Venue", "s", "".($UpdateTicketCount->getColumnVal("Venue")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("ShowDate", "t", "".($UpdateTicketCount->getColumnVal("ShowDate")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("TotalSold", "i", "".($UpdateTicketCount->getColumnVal("TotalSold")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("PreviousDaySold", "i", "".($UpdateTicketCount->getColumnVal("PreviousDaySold")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Wrap", "i", "".($UpdateTicketCount->getColumnVal("Wrap")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Capacity", "i", "".($UpdateTicketCount->getColumnVal("Capacity")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Open", "i", "".($UpdateTicketCount->getColumnVal("Wrap")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Advance", "s", "".($UpdateTicketCount->getColumnVal("Advance")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Dos", "s", "".($UpdateTicketCount->getColumnVal("Dos")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("OnSaleDate", "t", "".($UpdateTicketCount->getColumnVal("OnSaleDate")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("TM", "i", "".($UpdateTicketCount->getColumnVal("TM")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Hold", "i", "".($UpdateTicketCount->getColumnVal("Hold")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("FanClub", "s", "".($UpdateTicketCount->getColumnVal("FanClub")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Consignment", "i", "".($UpdateTicketCount->getColumnVal("Consignment")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Sold", "i", "".($UpdateTicketCount->getColumnVal("Sold")) ."", "WA_DEFAULT");
$UpdateQuery->addFilter("Id", "=", "i", "".($_GET['Id']) ."");
$UpdateQuery->execute();
$UpdateGoTo = "index4.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
<!--[if IE 7]> <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8]> <html class="ie8 oldie"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="">
<!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled Document</title>
<link href="boilerplate.css" rel="stylesheet" type="text/css">
<link href="update.css" rel="stylesheet" type="text/css">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="respond.min.js"></script>
</head>
<body>
<div class="gridContainer clearfix">
<div id="div1" class="fluid">
</div>
<section class="fluid UpdateTable">
<form action="index4.php?StoreID=<?php echo(intval($_GET["Id"])); ?>" name="submit" id="submit" method="post">
<table width="200" border="1">
<tbody>
<tr>
<td>Artist/Band: </td>
<td>
<input value= "<?php echo($UpdateTicketCount->getColumnVal("Artist")); ?>" />
</td>
</tr>
<tr>
<td>Venue: </td>
<td>
<input value= <?php echo($UpdateTicketCount->getColumnVal("Venue")); ?> maxlength="100" />
</td>
</tr>
<tr>
<td>Show Date:</td>
<td>
<input value = <?php echo($UpdateTicketCount->getColumnVal("ShowDate")); ?> /> </td>
</tr>
<tr>
<td>Total Sold:</td>
<td>
<input value = <?php echo($UpdateTicketCount->getColumnVal("TotalSold")); ?> />
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<input type = "hidden" name ="Id" value = "<?php echo($UpdateTicketCount->getColumnVal('Id')); ?>" />
<input name="submit" type="submit" id="submit" value="Update Record">
</form>