Jump to content

Telephone & address Directory


millercj

Recommended Posts

Hi everyone,

I'm looking for a solution for a website and I'm not sure if php is the answer. I have a membership directory (about 200 contacts) online in a SQL database. I want to create some sort of interface for website users to view the directory but not have any options to make changes to anything.

 

Any assistance you can offer would be fantastic

Link to comment
https://forums.phpfreaks.com/topic/98520-telephone-address-directory/
Share on other sites

Something like this would do the trick I think. Syntax I hope is correct, I just whipped it up in notepad so meh  :D

 

 

<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM person");
echo("<table border=1>\n
<tr>\n
<th>\n
first name\n
</th>
<th>\n
last name\n
</th>\n
</tr>\n");
while($row = mysql_fetch_array($result))
  {
  echo("<tr>\n
  <td>$row['firstname']</td>\n
  <td>$row['lastname']</td>\n
  </tr>");
  }
echo("</table>");
mysql_close($con);
?>

 

Well that would be your barebones directory anyway  ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.