$contactSql = "SELECT * FROM `Tickets` as t JOIN Contacts as co ON t.CustomerID=co.ContactId WHERE t.TicketNumber ='$ticketNumber' " ; $contactResult = $conn->query($contactSql); //echo "<pre>";print_r($contactResult);die; if ($contactResult->num_rows > 0) { $contactRow = $contactResult->fetch_all(MYSQLI_ASSOC); }
<table id="Customer_Contacts" class="table table-bordered" style="color:#F46813 ;border-color:#F46813;border:1px"> <thead class="thead-dark"> <th >Selected</th> <th>Name</th> <th>Phone Main</th> <th>Phone Mobile</th> <th>Phone Home</th> <th>Email</th> </thead> <?php $contactsEntryNumber= ['ContactsEntryNumber']; foreach ($contactRow as $key=>$value){?> <tr> <td><?php if($value['Select'] =='-1'){?> class="fa fa-check-circle-o"> <?php }?></td> <td><?=(($value['ContactLast'] !='') ? $value['ContactFirst'].' '.$value['ContactLast'] :'')?></td> <td><?=(($value['PhoneMain'] !='') ? $value['PhoneMain'] :'')?></td> <td><?=(($value['PhoneMobile'] !='') ? $value['PhoneMobile'] :'')?></td> <td><?=(($value['PhoneHome'] !='') ? $value['PhoneHome'] :'')?></td> <td><?=(($value['Email'] !='') ? $value['Email'] :'')?></td> <td><button class=\"btn btn-primary btn-sm\"><a href=\"contacts_edit.php?updateid=$contactsEntryNumber\" class=\"text-light\">EDIT</a></button></td> </tr> <?php }?> </table>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)