Note that there are some explanatory texts on larger screens.

plurals
  1. POImporting MySQL Data into Single Bootstrap Modal Box?
    text
    copied!<p>Had such great success with my last question, thought I'd try another.</p> <p>I'm building a "dashboard" for the company I work for, a printing facility. This dashboard will list all of the current jobs in progress, jobs completed, etc. (It will really make life better for everyone there).</p> <p>I have all of my customer information pulled from a MySQL Database using a PHP query and displayed into a DataTable using a PHP while loop. I have an edit button at the end of each row that opens up a Modal box, displaying and allowing the printer to enter information and update the database.</p> <p>This was working, but I began to think... all is well with only a handful of customers plugged in, but once we have 1,000+ customers, each given a Modal box (from the PHP while loop) it's going to get overwhelming.</p> <p>Can anyone explain to me, if it is even possible, to have a single Modal Box code on the page that pulls the exact customer data into it when the link is clicked, launching the box.</p> <p><strong>Button Launching The Modal (This is in a PHP while loop):</strong></p> <pre><code>&lt;a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#modal_id\" href=\"display=" . $row['id'] . "\"&gt; &lt;i class=\"icon-question-sign icon-white\"&gt;&lt;/i&gt; &lt;/a&gt; </code></pre> <p><strong>Modal Code Itself (NOT in PHP while loop):</strong></p> <pre><code>&lt;div class="modal hide fade" id="modal_id"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;×&lt;/button&gt; &lt;h3&gt;Project Details&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; ID is &lt;?php echo $display ?&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;a href="#" class="btn btn-primary" data-dismiss="modal"&gt;Save Changes&lt;/a&gt; &lt;a href="#" class="btn" data-dismiss="modal"&gt;Close&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The text inside just reads: ID is The variable isn't being passed through the buttons href.</p> <p>Any solutions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload