jeudi 2 juillet 2015

OnClick of Checkbox Add or Remove MySql Data (Without using AJAX)

I'm not able to understand how can I apply WHERE status!='disable' in my php code at $result after I click on the checkbox and then on uncheck of the checkbox it should be removed again is that possible without using AJAX codes, if it is then how can I do that.

I've created a checkbox, code given below:

<h4 id="CATEGORIESfilters">Availability</h4>
    <table border="0" cellspacing="0" id="Availabilitytable">
        <tr>
            <td>
                <input type="checkbox" name="Availability" id="Availabilitycheckboxexcludeoutofstock" >
            </td>
            <td>
                <label for="Availabilitycheckboxexcludeoutofstock">Exclude Out Of Stock</label>
            <td>
        </tr>
    </table>

My Php code is given below:

<?php
    include "db_connection.php";
    $result = mysql_query("SELECT * FROM burger ORDER BY product_no_id DESC");
    while($data=mysql_fetch_array($result)):
    if($data['status']=="enable")
    {
?>
<div class="productwrap">

</div>
<?php
    }
        else
    {
?>
<div class="productwrap">
    <div id="Outofstockwrap">
            Out Of Stock
    </div>
</div>
<?php
    }
    endwhile;
?>

I'm not able to understand how can I apply WHERE status!='disable' in my php code at $result after I click on the checkbox and then on uncheck of the checkbox it should be removed again is that possible without using AJAX codes, if it is then how can I do that.




Aucun commentaire:

Enregistrer un commentaire