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 user ID) via GEt since the URL doesn't change, or by POST since the page doesn't refresh ...

in my file the php variable is $userID= 3455; ... which changes at everyline

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>

Ho can I retrieve $userId in the modal so I can do an Mysql query on it ? (i understand there is a conglit 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 ?

thnaks in advance!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.