Find value first row and first column to make a query

0

I would need to make a query with two variables when clicking on a link in a cell:

  • Value of the column
  • Value of the first row
  • I have the following table:

    +--------+----------+----------+
    |  Name  |   Open   |   Close  |
    +--------+----------+----------+
    | user1  |     0    |     1    |
    | user2  |     3    |     0    |
    | user3  |     1    |     1    |
    +--------+----------+----------+
    

    And I have the modal window that for example if I click on the number 3 I should save the values " Open " and " user2 " and in that way to be able to make a query:

    <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">            
    <?php include("conn.php");                 
    $result = mysql_query("Select * from table where status = 'Open' and Name = 'user2'");               
    while($test = mysql_fetch_array($result)) {
        $id = $test['id']; 
        echo"<div class='form-group'>";
        echo"<label for='s'>".$id." ".$city."</label>";
        echo"</div>";
    }
    mysql_close($conn); 
    ?> 
    </div>
    

    What should I adapt to do it? Thanks!

        
    asked by Guif If 17.11.2018 в 21:01
    source

    0 answers