Hello how can i implement a search string in this kind of html table?
I have found http://phpsnips.com/snip-94
but i do not have the skils to implement. Some help will be usefull thank you
<?php
$s=$_GET["s"];
mysql_select_db("cazier");
$sql="select * from contacts";
$contactsArray = array();
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$contactsArray[] = $row;
}
foreach($contactsArray as &$contact){
$contact['notes']=array();
$result2 = mysql_query("select notes.note_text AS 'note_text', users.user_nume AS 'user_nume', users.user_email AS 'user_email', users.user_telefon AS 'user_telefon', users.user_firma AS 'user_firma' from notes, users where notes.note_contact='".$contact['contact_id']."' AND users.user_id=notes.note_user");
while ($row2 = mysql_fetch_assoc($result2)){
$contact['notes'][] = $row2;
}
mysql_free_result($result2);
}
$test="<a href=''>Adauga detalii sofer</a>";
$tableHtml = "<table border ='1' bgcolor='#ffffdd' id='tester' width='900' border='0' cellspacing='0' cellpadding='0'><tr>
<th align=\"center\" colspan='3'>Nume sofer</th>
<th align=\"center\" colspan='3'>CNP </th>
<th align=\"center\" colspan='3'>Telefon sofer</th>
<th align=\"center\" colspan='3'>Detalii sofer</th>
</tr>";
for ($i=0;$i<count($contactsArray);$i++) {
$tableHtml .= "<tr>
<td width=\"10%\" align=\"center\" colspan='3'>".$contactsArray[$i]['contact_first']." ".$contactsArray[$i]['contact_last']." </td>
<td width=\"10%\" align=\"center\" colspan='3'>".$contactsArray[$i]['contact_title']." </td>
<td width=\"10%\" align=\"center\" colspan='3'>".$contactsArray[$i]['contact_phone']." </td>
<td width=\"70%\" colspan='3'> ";
$notesString = "<ul><table border='1' width='550' ><tr>";
foreach ($contactsArray[$i]['notes'] as $note){
$notesString .= "<tr><td BGCOLOR=\"#DDDDDD\"><center>".$note['user_firma']."</center>";
$notesString .= "<center>".$note['user_nume']."</center>";
$notesString .= "<center>".$note['user_email']."</center>";
$notesString .= "<center>".$note['user_telefon']."</center>";
$notesString .= "<center><font color='#0404B4'> Note si comentarii : </font></center>";
$notesString .= "<center>".$note['note_text']."</center></td></tr>";
}
$notesString .= "</tr></table></ul>";
$tableHtml .= $notesString ;
$tableHtml .= "<center><a href='#' data-usrid='".$contactsArray[$i]['contact_id']."' class='modal'>Adauga detalii</a> </center></td></tr>";
}
$tableHtml .= "</table>" ;
echo $tableHtml;
?>