I have a php loop that writes hundrends of records, I need to have a button on each line to trigger a bootstrap modal that will allow to edit this specific record. can't really sent the line ID (it's a user ID) via GET since the URL doesn't change, or by POST since the page doesn't refresh ... I tried with AJAX but could seem to figure it out.
in my file the php variable is $userID= some number; ... which changes at every line
so every line refers to the same modal in which i added a data-id (or is there any other way to pass tha value to my modal?)
<a href="#" class="btn btn-success"
data-toggle="modal"
data-target="#editUser"
id="theuser"
data-id="<?php echo $userID;?>">
Update
</a>
How can I retrieve $userId in the modal so I can do an Mysql query on it ? (i understand there is a seperation between the server side aspect of php and the fact the data-id is only browser based ... but there must be a way to generate dynamically content using php for a modal ?
thanks in advance!