Php 具有动态映像src的模式中的引导打开映像
我的问题是关于这个答案Php 具有动态映像src的模式中的引导打开映像,php,jquery,twitter-bootstrap,Php,Jquery,Twitter Bootstrap,我的问题是关于这个答案 如何显示来自MySQL数据库的src图像?简单地echo来自数据库的img源 <?php if(isset($_POST['profile_id'])){ var uid=$_POST['profile_id']; $result->query("SELECT profile FROM user WHERE uid=$uid"); $row=$result->fetch_array(); die(json_e
如何显示来自MySQL数据库的src图像?简单地
echo
来自数据库的img源
<?php
if(isset($_POST['profile_id'])){
var uid=$_POST['profile_id'];
$result->query("SELECT profile FROM user WHERE uid=$uid");
$row=$result->fetch_array();
die(json_encode($row));
}
?>
Sarath我知道PHP部分。我想知道如何使用jquery和bootstrap在modal中显示图像。
<a href="#" class="pop">
<img src="" style="width: 400px; height: 264px;">
</a>
$.post("ajax.php",{profile_id:1},function(response){
if(response){
var profileImg=JSON.parse(response);
profileImg=profileImg[0].profile;
$('.pop img').attr('src','http://example.com/image/'+profileImg);
$('.pop').modal('show');
}
});