Hey everyone,

Having a few problems:

  1. It's not populating the dropdown with all the entries (But in the delete function it is, which is a somewhat copy)
  2. It doesn't post the Employer name, the result I'm getting is "Editing user: BLANK"

Here is the code:

function JobBoard_admin_edit() 

             echo "<h4> edit </h4>";
            <form name="jobboard_form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
                echo '<select name="ID">';

                $con_edit= mysqli_connect("localhost", "profiled_job","", "profiled_jobboard") or die(mysql_error());
                $sql="SELECT ID,Employer FROM details";
                $result =mysqli_query($con_edit,$sql);
                //$employer_id = $_POST['ID'];
                while ($data=mysqli_fetch_assoc($result))

                    echo '<option value ="' . $data['Employer'] . '">'. $data['Employer'] . '</option>';
                    echo "</select>";
                    echo "<p>";
                    echo "<input type='submit' value='Update User' name='updateuser'></p>"; 
                    echo "</form>";

                        $emp = $employer_id;
                        $sql = (mysqli_query($con_edit, "SELECT * FROM details WHERE Employer = '$emp'"));
                                echo "Editing user:" . $emp . "<p>";
                            echo "Data Not found";
                            echo $emp;



Uncomment line 13.

Thanks Prit, but what about the drop down not populating properly?

The Delete function works and it looks like this:

<form method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">  
                <select name='ID'>
                        $con= mysqli_connect("localhost", "profiled_job","", "profiled_jobboard") or die();
                        $sql= "SELECT ID,Employer FROM details";
                        $result =mysqli_query($con,$sql);
                        while ($data=mysqli_fetch_assoc($result)){
                  <option value ="<?php echo $data['ID'] ?>"><?php echo $data['Employer'] ?></option>
                     <?php } ?>
                        <input type="submit" value="Delete User" name='delete'></p> 

This one uses the password.

The last one uses ID and Employer.

The select tag ending should be outside the loop, DOH!