I have a working form that allows the user to add invoices to a database, it will then display the invoices in a table, within the table there in a email button within the Name
section. When the user clicks the button it will pull up a bootstrap modal that asks for the email, subject, and content. It will then shoot an email address to the entered email address. This is working perfectly, however i would now like it to grab the email address that's associated with the name inside the database.
This is what i've been trying with no success
Home.php
<div class="form-group">
<label class="col-md-4 control-label" for="email">Email:</label>
<div class="col-md-5">
<input id="email" name="email" type="text" placeholder="placeholder@gmail.com" class="form-control input-md"
value="<?php echo $query['email']?>">
</div>
</div>
up in my code im connecting o the database like this
$query = mysql_query("SELECT id, Rep, Date, email, Name, P_O, ADDDATE(Date, Terms) AS Due_Date, Terms, GREATEST(DATEDIFF(NOW(), ADDDATE(Date, Terms)), 0) AS Aging, Open_Balance from Book1");
So what im looking for is when the suer clicks the email button next to the customers Name, it will auto fill the modal with the emailaddress thats in the same ROW as the Name.