Having a time here...
I am trying to pull back a category based on a pre-populated form selection box the user submits. It works like this:
User is presented the form that has a drop box selection list to update a category. User selects the category they want to update and press submit. That form field is presented against the database, if good, it brings back to the user the complete category data to update. I can't seem to get the last part working right:
<?
// include function files for this application
require_once("fns.php");
$POST['catid'] = addslashes($POST['catid']);
admin_header();
echo "<BR><FONT FACE='ARIAL, HELVETICA' SIZE='1' COLOR='333366'>To update your category, change the information below and click submit. <BR>Your category information will be updated in your cart database<BR>";
@ $db = mysql_pconnect("localhost", "root", "root");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("book_sc");
$query = ("SELECT catid, cat_image_type FROM categories WHERE ".$_POST['catid']." = '%".$catid."%'");
$result = mysql_query($query);
printf("Catgory Name: %s<br>\n", mysql_result($result,0,"first"));
do_html_footer();