CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #7
    Join Date
    Jun 2004
    Posts
    142

    Re: I've done the searching

    here is a full example that I actually use on my local server. Excuse the french text
    where you see the include of connection.php, you wont need that, this is the same connection stuff as above.

    Code:
    <table width="560" border="0" cellspacing="1" cellpadding="2">
       <tr bgcolor="#c7c7c7">
       <td width="160" align="center" class="reg_font">Nom</td>
       <td width="180" align="center" class="reg_font">Courriel</td>
       <td width="110" align="center" class="reg_font">T&#233;l&#233;phone</td>
       </tr>
    	<?php
    	include "connection.php";
    	$query = "select * from contacts where id != '3' order by lname";
    	$Statement = mysql_query($query);
    	while($myid = mysql_fetch_array($Statement)) {
    	$the_id = $myid["id"];
    	$last_name = $myid["lname"];
    	$first_name = $myid["fname"];
    	$email = $myid["e_address"];
    	$phonenum = $myid["phone"];
    	if($bg == "#ededf7"){
    	$bg = "#e7e7e7";
    	}else{
    	$bg = "#ededf7";
    	}
    	if(empty($phonenum)){
    	$phonenum = "&nbsp;";
    	}
    	echo "<tr bgcolor=\"".$bg."\">\n";
    	echo "<td class=\"reg_font\">".$last_name.", ".$first_name."</td>\n";
    	echo "<td class=\"reg_font\"><a href=\"mailto:".$email."\" class=\"link_font\">".$email."</a></td>\n";
    	echo "<td class=\"reg_font\">".$phonenum."</td>\n";
    	echo "<tr>\n";
    	}
    	?>
    	</table>
    Last edited by bobo; March 11th, 2010 at 01:54 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured