Passing data from page to bootstrap modal using SQL & PHP

后端 未结 2 1177
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-28 07:11

So as per title, im trying to pass show multiple data from database using sql on the bootstrap modal. The ID will be pass down from the link, how is it done? been finding multip

2条回答
  •  花落未央
    2021-01-28 07:37

    Create one class openModal in . Use this class in to get data-id

    
            
                
                
                
                                                 
                    
                        
                    
                
            
    
    

    Place this code in the same page below.

    
    

    JS (data-id=.. is passed here.)

    
    

    ajax_modal.php (Create one page in same directory ajax_modal.php. If you are looking to change this page name. Change in tag too. Both are related.)

    `
    $id = $_GET['id'];
    
    $sel_query=mysqli_query($conn, "select * from admin where admin_id='$id'") or die(mysql_error($conn)); 
    $selrow=mysqli_fetch_array($sel_query,MYSQLI_ASSOC);
    ?>
    
    
    
    
    

    For more info, click here

    1. how-to-pass-current-row-value-in-modal
    2. passing-data-via-modal-bootstrap-and-getting-php-variable
    3. bootstrap-modal-and-passing-value
    4. show-data-based-of-selected-id-on-modal-popup-window-after-click-a-button-php-my

提交回复
热议问题