php - Pull row data into modal window -
i have mysql query within php function:
$sql_json = "select * mytable";
i displaying returned data table grid. first row has edit button once user clicks on it, opens modal window. should transfer data row bootstrap modal window.
echo "<tr><td> <a class=\"btn btn-primary btn-mini\" data-toggle=\"modal\" href=\"#myeditmodal\" data-project-id=\"" .$row['pk_tid']. "\" \">delete/edit</a></td>";
now trying $row['pk_tid']
modal window here:
<div class="modal hide fade" id="myeditmodal" tabindex="-1" role="dialog" aria-labelleby="mymodallabel" aria-hidden="true"> <div class="modal-header"> <div class="modal-body"> <form class="well-small" action="edit.php" method="post" id="modalform" name="modalform"> <input type="text" id="group" name="group" value="<?php echo $selection[mygroup]; ?>" /> <input type="submit" id="modal-form-submit" name="submit" class="btn btn-primary" href="#" value="update" /> </form> </div> </div>
once able pk_tid
in modal window, should able perform query retrieve data table.
i know can done php.
please help.
******************** update *****************
$sql_json = "select * restable"; $queryresult = @mysql_query($sql_json) or die (mysql_error()); echo "<table class='table table-striped table-bordered table-hover'>\n"; while(($row = mysql_fetch_assoc($queryresult)) !== false) { echo "<tr><td> <a class=\"btn btn-primary btn-mini\" data-toggle=\"modal\" href=\"#myeditmodal\" data=\"edit.php?id=\"".$row['pk_tid']."\">delete/edit</a></td>"; echo "<td>{$row[resgroup]}</td>"; echo "<td>{$row[mytype]}</td>"; echo "<td>{$row[myservice]}</td>"; echo "<td>{$row[mydescription]}</td></tr>\n"; }; echo "</table>\n";
i think you're asking for. please let me know else need.
Comments
Post a Comment