need radio button to set feature pic
Posted: Thu Aug 02, 2007 9:25 am
My form has a YES NO radio button feature that sets the "FEATURE PIC": YES NO - and NO is the checked default.
Here is an image of the form http://www.forthosewhowait.com/images/c ... page02.jpg
here is the form code
The redisdential table has a field called res_feature_pic, it holds the image id of the feature picture ($imageid). When the admin selects YES and SUBMIT, the current picture being edited gets its $imageid written to res_feature_pic
The PHP coding is the mystery.
I get this: Error UPDATING Feature Picture!Query was empty
.
Here is an image of the form http://www.forthosewhowait.com/images/c ... page02.jpg
here is the form code
Code: Select all
<td width='160' align='left' valign='top'><span class='caption_cap'>Feature Picture</span><br>
<input name='featurepic' type='radio' value='<?php $image_res_id;?>' ><span class='caption_cap'>yes</span>
<input name='featurepic' type='radio' value='<?php $resfeaturepic;?>' checked='checked' ><span class='caption_cap'>no</span></td>The redisdential table has a field called res_feature_pic, it holds the image id of the feature picture ($imageid). When the admin selects YES and SUBMIT, the current picture being edited gets its $imageid written to res_feature_pic
The PHP coding is the mystery.
Code: Select all
$_POST['featurepic'];
if ($image_res_id == 'checked') {
$setfeaturepic = "UPDATE residential SET
res_feature_pic='$imageid'
WHERE res_id='$id'"; }
if (!mysql_query($setfeaturepic)) {
echo "<p>Error UPDATING Feature Picture!"
. mysql_error() . "Call webmaster";
}I get this: Error UPDATING Feature Picture!Query was empty
.