html - AJAX PHP DATABASE DropDown List Fill Insert Image -
how add img src = in code? in advance
function fill_product($connect) { $output = ''; $sql = "select * tblstdpro"; $result = mysqli_query($connect, $sql); while($row = mysqli_fetch_array($result)) { $output .= '<div class="col-md-3">'; $output .= '<div style="border:1px solid #ccc; padding:20px; margin-bottom:20px;">'.$row["stdimage"].'</br>'.$row["stdid"].'</br>'.$row["fname"].' '.$row["lname"].''; $output .= '</div>'; $output .= '</div>'; } return $output; }
how can put image src in
'.$row["stdimage"].'
try this
while($row = mysqli_fetch_array($result)) { $image = $row["stdimage"]; $output .= '<div class="col-md-3">'; $output .= '<div style="border:1px solid #ccc; padding:20px; margin-bottom:20px;"><img src="'.$image.'"></br>'.$row["stdid"].'</br>'.$row["fname"].' '.$row["lname"].''; $output .= '</div>'; $output .= '</div>'; }
what have done stored value of image in $image
variable , used <img src="'.$image.'">
Comments
Post a Comment