hi there scankified,
Firstly I hope as you altered the sql string from what you posted on your last message, as the value from $book_id is not added to the query properly:-
$sql = "UPDATE `books` SET `readstatus` = '".$readstatus."' WHERE `book_id` = '".$book_id."' LIMIT 1";
It needs to be enclosed bewteen the '' single quotes so that when it is passed to the database, the value is then interpreted correctly, the LIMIT 1 clause just says only 1 record to be returned, if that's not how you require it just do this:
$sql = "UPDATE `books` SET `readstatus` = '".$readstatus."' WHERE `book_id` = '".$book_id."' ";
Secondly print_r();
"Prints human-readable information about a variable" quote from php.net
Use this to view the $_POST array
after it's been sent OR when it's set, which is more contextually correct ;-p
It's a great tool to use for seeing what's in an array - good for
debugging $values_in_array = array("one","two","three","four");
print_r($values_in_array);
outputs to screen:
array(
"0" => "one",
"1" => "two",
"2" => "three",
"3" => "four",
)
Thirdly
<option value="<?php echo $row['readstatus'];?>" SELECTED><?php echo $row['readstatus'];?></option>
You missed the ; semi-colon from the echoed var..
Maybe I'm reading this wrong but:-
<?php echo '10%'; if (isset($_POST['readstatus'])); ?>
What's this doing? there is no action to the clause
if(isset($_POST['readstatus']))
{
//do something if this evaluates to true
}else{
//do something if this evaluates to false
}
Depending on how you do this and what you want to happen you don't necessarily need the else{} part
I'm not sure as this is correct syntax though, new to me if it is ;-p
if (isset($_POST['readstatus']));
It's not doing anything?!?
[EDIT]
Something has just occurred to me, could you post the code where the 'book_id' var is actually set in the <a href> link please, see if the link is getting set correctly :)
Hopefully that clears a few issues up for you..
Cheers,
MRb