How to pull data from database table (Help Please)

Ben144

Member
Jan 31, 2017
76
5
Hey,

I am using flurxRP emulator and cms and I am using a select/option on a form, where i want to have the option to set the option to either Pending or accepted, both option have been added to the database table and is fully working. But will i add the select and option attribute, then it only pulls "Pending" from the database table, Whereas i want it where you click on the dropdown select option and you can see accepted their and you just click it and once click then it updates the database table. How can i go about this.

Code:
<select>
            <option value="' . $chat['b_status'] . '">' . $chat['b_status'] . '</option>
            <option value="' . $chat['b_status'] . '">' . $chat['b_status'] . '</option>
        </select>

Any help Appreciated and thanks in advance
 

Ben144

Member
Jan 31, 2017
76
5
You need to make an inner loop inside the select to print out all the options.
I have got it working to an extent, but it is not updating to the database.

Code:
<?php
                if(isset($_POST['sendReviewSub'])){
                    $errors = array();
                    $failed = 0;
                    $status = filter($_POST['b_status']);
                    if($status != "Pending" && $status != "Accepted" && $status != "Rejected"){
                        $errors[] = "IP Logged for trying to exploit.";
                    }else{
                        mysql_query("UPDATE INTO `rp_business_apps` (b_status, userid) VALUES ('".$status."', '".$_SESSION['user']['id']."')") or die(mysql_error());
                        echo "<center><p style='color:green;'>Suggestion Sent!</center></p>";
                    }
                }
                
                ?>
                <form method="post" name="sendReport">
                    <select name="b_status">
                        <option value="Pending">Pending</option>
                        <option value="Accepted">Accepted</option>
                        <option value="Rejected">Rejected</option>
                    </select>
                    
                    <input type="submit" value="Send In" name="sendReportSub">
                </form>
 
Last edited:

Object

?
Nov 10, 2017
430
352
I have got it working to an extent, but it is not updating to the database.

Code:
<?php
                if(isset($_POST['sendReviewSub'])){
                    $errors = array();
                    $failed = 0;
                    $status = filter($_POST['b_status']);
                    if($status != "Pending" && $status != "Accepted" && $status != "Rejected"){
                        $errors[] = "IP Logged for trying to exploit.";
                    }else{
                        mysql_query("UPDATE INTO `rp_business_apps` (b_status, userid) VALUES ('".$status."', '".$_SESSION['user']['id']."')") or die(mysql_error());
                        echo "<center><p style='color:green;'>Suggestion Sent!</center></p>";
                    }
                }
             
                ?>
                <form method="post" name="sendReport">
                    <select name="b_status">
                        <option value="Pending">Pending</option>
                        <option value="Accepted">Accepted</option>
                        <option value="Rejected">Rejected</option>
                    </select>
                 
                    <input type="submit" value="Send In" name="sendReportSub">
                </form>
Change sendReviewSub to sendReportSub

Right now you're checking if something is set that doesn't exists hence it never gets inside the if
 

Users who are viewing this thread

Top