note 80172 deleted from function.odbc-exec by felipe
| From: | felipe@php.net | Date: | Thu, 03 Jan 2008 01:31:05 +0000 |
| Subject: | note 80172 deleted from function.odbc-exec by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134675@lists.php.net to get a copy of this message | ||
Note Submitter: wcwjwd @ spamless yahoo dot comspamfreee
----
I have an include that houses functions which run sql, and I have a form that relies on the values
in that sql server. For example:
//My include, x.inc
<?php
function RemoveSomething($a)
{
odbc_execute($con, "DELETE * FROM tTable WHERE (FieldID = $a);
return "Deleted.";
}
?>
//My index.php
<?php
include "x.inc";
if (isset($_POST['a']))
$return = RemoveSomething($_POST['a']);
?>
<form>
<select>
<?php
DrawDropdownBoxOfDataFromtTable();
?>
</select>
</form>
and it draws the whole list, including what should be deleted. If I reload the page (without
resending POST data), the record IS deleted, as expected and reported. It's also reflected in
the SQL database. However, on the page, when it loads, DrawDropdownBoxOfDataFromtTable still shows
the record that is being deleted. Any help would be great.