Greetings,
Im working on some code to create a button to clear the collective search results section.
im having trouble finding the exact tables to address. This is the code I have so far.
QUOTE:
/********************
** admin/main.php**
************************/
<p>
<a href="clear_search.php?<?=session_name()?>=<?=session_id()?>">Clear
Search</a>.
<br>
QUOTE:
<?php
/***************************
** admin/clear_search.php***
****************************/
/*
* Change the first line to whatever
* you use to connect to the database.
*
* Change tablename to the name of your
* database table.
*
* This example would delete a row from
* a table based on the id of the row.
* You can change this to whatever you
* want.
*/
// Your database connection code
db_connect();
$query = "TRUNCATE TABLE tablename WHERE id = ('$id')";
$result = mysql_query($query);
echo "The data has been deleted.";
?>
Suggestions are welcome.
Note, I use quotes instead of code because Internet Explorer mashes the code together so that its very hard to read. Mozilla displays it correctly.