0
<?php if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); } ?>

                    <?php 
                        $vouch = mysql_query("SELECT * FROM cms_vouchers"); 
                        while ($voucher = mysql_fetch_assoc($vouch)) { 
                            $username = $voucher['user_id']; 
                            if(($_SESSION['user']['username']) == "$username") { 

                    ?>

                    <div id="page-content-text" class="left">
                        <div id="contentTitle" class="red">%hotel_name% Alert: Enter the voucher code <?php echo $voucher['code'] ?> 
                        to receive <?php echo $voucher['smileys_points'] ?> </div>
                    </div>   

                    <?php        
                            } 
                        } 
                    ?>


                    I need a little help with the code above to not return the voucher code once it has been used, From using a ENUM in the database table 0 for unused and 1 for used
2
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by Avicii
0

Could you help do the other part, Not so good with PHP Myself :(

Also the table name is named used and the table is called cms_vouchers

0

Managed to do it with

$vouch = mysql_query("SELECT * FROM cms_vouchers WHERE used = '0'");
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.