Not quite understanding the process
Hi Eric,
Thanks for the reply. I'm not understanding the process so the search isn't working. All the record still show up.
This is what I have done so far –
RESULTS page:
I added the check box to each item (am not sure what you meant by add in brackets after the name of the checkbox).
Here is the code for the checkbox –
<input name="product_id" type="checkbox" id="product_id" value="<?php echo $row_WADAwProd_Bread['product_id']; ?>" />
At the bottom of the list is a text link that goes to the multiple update page –
<a href="wBread_updateMulti.php?product_id=<?php echo((isset($_POST["product_id"]))?$_POST["product_id"]:"") ?>">Update Multiple Records</a>
Not sure if I need the parameters!
MULTIPLE UPDATE Page:
This is where I am not understanding the search behaviour.
I added the following using the DatataAssist Search behaviour. It is at the top before the update code –
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: rsProdBread;
//Searchpage: ;
//Form: ;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromList("product_id","".$row_rsProdBread['product_id'] ."","AND","=",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_wBread_updateMulti"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_wBread_updateMulti"]) && $_SESSION["WADbSearch1_wBread_updateMulti"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_wBread_updateMulti"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
Do you need any more information? Or can you see where I have made errors.
Regards, Peter