Friday, 15 May 2015

php - How to prevent update query from automatically running till open modal -



php - How to prevent update query from automatically running till open modal -

i have been using this modal script run query on page. however, when set update query in modal content box, automatically runs 1 time page loaded. however, want run 1 time user opens modal box. so, here modal box code far:

<div class="md-modal md-effect-1" id="modal-1"> <div class="md-content"> <h3>success!</h3> <div> <?php $id = $_get['id']; $query = $db->query("update mybb_tnybracket set player2 = '$username' tid = '$id' , player1 not null , player2 null")or die(mysql_error()); ?> <p>content has been updated!</p> <button class="md-close">close me!</button> </div> </div> </div> <button class="md-trigger" data-modal="modal-1">update information?</button>

i unable find way create query wait until modal open. makes sense why automatically run query, need hold off until it's opened! can seem help?

php jquery mysql

No comments:

Post a Comment