M
|
michaelmac author 6/4/2007 |
Hey Everyone I need to use the select buttons on the "list" page, and instead sending it to export or print selected, I need to write those selected to another table? Any hints or already existing code? Thanks Mike
|
J
|
Jane 6/4/2007 |
Mike,
and add following code just before: <A onclick="if (!confirm('Do you really want to insert these records?')) return false; frmAdmin.a.value='insert'; frmAdmin.submit(); return false;" href="TableName_list.htm#">Insert selected</A>
function BeforeDelete($where) { //if you click on the delete link if(@$_POST["a"]=="delete") return true; //if you click on the insert link global $conn; $str = "select field1,field2 from TableName where ".$where; $rs = db_query($str,$conn); $data = db_fetch_aray($rs); $strSQL="insert into AnotherTableName (FieldName1,FieldName2) values ('".$data["field1"]."','".$data["field2"]."'); db_exec($strSQL,$conn); return false; } |
M
|
michaelmac author 6/4/2007 |
Mike, here is a step-by-step instruction:
|
J
|
Jane 6/5/2007 |
Mike, echo "where variable: ".$where; |
M
|
michaelmac author 6/6/2007 |
Thank You Jane |
M
|
michaelmac author 6/6/2007 |
Mike, the best way to see value of $where variable is to print it on the page:
|
M
|
michaelmac author 6/8/2007 |
Thank you Jane. I am going to implement the code in the morning. I do have a question though, what does the variable $where represent? I mean I am not sure if I assign it some value, or does it have one already. This solution (I hope) will allow me the ability to solve a couple of issues. The mass mailing and the mass insert from the _list.php page. I still need to know how to enter a "text" box so my user can enter in a value I will write to the table. Thanks for all you help Mike
|
M
|
michaelmac author 6/11/2007 |
Hey Guys/Gals... |