Jump to content

cjt

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cjt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Firstly I'm completely new to this game so bare with me please! I've installed easy php and using phpMyAdmin I have setup a database for a list of employees in an office, I have managed to get some help to return this information to a webpage using some php and sql, but now I want people to be able to go on the site and update their status (either in or out), any help would be great. Here is my code (which is basically an example I used, not fully understanding!) for displaying the information from the database on the website. The information from the database can be viewed and is formatted in two ways either in a simplified verision on the home page or a detailed way if the user clicks on the link. // Connect to MySQL require("../mysql.php"); $QUERY = mysql_query("SELECT ID, Name, Email, Extension, DirectDial, Status FROM contacts ORDER BY Name ASC"); if(isset($_GET['detailed'])) { echo("<tr style=\"padding:3px;\">\n\n"); echo("<td class=\"contact_field\">\n"); echo("<b>Name</b>"); echo("</td>"); echo("<td class=\"contact_field\">\n"); echo("<b>Email</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Extension</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Direct</b>"); echo("</td>"); echo("<td class=\"contact_field\">\n"); echo("<b>Status</b>"); echo("</td>"); echo("</tr>"); while($row = mysql_fetch_array($QUERY, MYSQL_ASSOC)) { echo("<tr style=\"padding:3px;\">\n"); echo("<td width=\"150px\" class=\"contact_field\">\n\n"); echo($row['Name'] . "\n\n"); echo("</td>\n"); echo("<td width=\"300px\" class=\"contact_field\">\n"); echo("<a href=\"mailto:" . $row['Email'] . "\">" . $row['Email'] . "</a>\n\n"); echo("</td>\n"); echo("<td width=\"100px\" align=\"center\" class=\"contact_field\">\n"); echo($row['Extension'] . "\n\n"); echo("</td>\n"); echo("<td align=\"center\" class=\"contact_field\">\n"); echo($row['DirectDial'] . "\n\n"); echo("</td>\n"); echo("<td align=\"center\" class=\"contact_field\">\n"); echo($row['Status'] . "\n\n"); echo("</td>\n"); echo("</tr>\n"); } } else { echo("<tr style=\"padding:3px;\">\n\n"); echo("<td class=\"contact_field\">\n"); echo("<b>Name</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Extension</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Status</b>"); echo("</td>"); echo("</tr>"); while($row = mysql_fetch_array($QUERY, MYSQL_ASSOC)) { echo("<tr style=\"padding:3px;\">\n"); echo("<td width=\"180px\" class=\"contact_field\">\n\n"); echo("<a href=\"mailto:" . $row['Email'] . "\">" . $row['Name'] . "</a>\n\n"); echo("</td>\n"); echo("<td class=\"contact_field\" align=\"center\">\n\n"); echo($row['Extension'] . "\n\n"); echo("</td>\n"); echo("<td class=\"contact_field\" align=\"center\">\n\n"); echo($row['Status'] . "\n\n"); echo("<a href=\"http://www.intertraffic.com" . $row['Status'] . "\">" . $row['Name'] . "</a>\n\n"); echo("</td>\n"); echo("</tr>\n"); } } ?>
  2. Firstly I'm completely new to this game so bare with me please! I've installed easy php and using phpMyAdmin I have setup a database for a list of employees in an office, I have managed to get some help to return this information to a webpage using some php and sql, but now I want people to be able to go on the site and update their status (either in or out), any help would be great. Here is my code (which is basically an example I used, not fully understanding!) for displaying the information from the database on the website. The information from the database can be viewed and is formatted in two ways either in a simplified verision on the home page or a detailed way if the user clicks on the link. // Connect to MySQL require("../mysql.php"); $QUERY = mysql_query("SELECT ID, Name, Email, Extension, DirectDial, Status FROM contacts ORDER BY Name ASC"); if(isset($_GET['detailed'])) { echo("<tr style=\"padding:3px;\">\n\n"); echo("<td class=\"contact_field\">\n"); echo("<b>Name</b>"); echo("</td>"); echo("<td class=\"contact_field\">\n"); echo("<b>Email</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Extension</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Direct</b>"); echo("</td>"); echo("<td class=\"contact_field\">\n"); echo("<b>Status</b>"); echo("</td>"); echo("</tr>"); while($row = mysql_fetch_array($QUERY, MYSQL_ASSOC)) { echo("<tr style=\"padding:3px;\">\n"); echo("<td width=\"150px\" class=\"contact_field\">\n\n"); echo($row['Name'] . "\n\n"); echo("</td>\n"); echo("<td width=\"300px\" class=\"contact_field\">\n"); echo("<a href=\"mailto:" . $row['Email'] . "\">" . $row['Email'] . "</a>\n\n"); echo("</td>\n"); echo("<td width=\"100px\" align=\"center\" class=\"contact_field\">\n"); echo($row['Extension'] . "\n\n"); echo("</td>\n"); echo("<td align=\"center\" class=\"contact_field\">\n"); echo($row['DirectDial'] . "\n\n"); echo("</td>\n"); echo("<td align=\"center\" class=\"contact_field\">\n"); echo($row['Status'] . "\n\n"); echo("</td>\n"); echo("</tr>\n"); } } else { echo("<tr style=\"padding:3px;\">\n\n"); echo("<td class=\"contact_field\">\n"); echo("<b>Name</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Extension</b>"); echo("</td>"); echo("<td class=\"contact_field\" align=\"center\">\n"); echo("<b>Status</b>"); echo("</td>"); echo("</tr>"); while($row = mysql_fetch_array($QUERY, MYSQL_ASSOC)) { echo("<tr style=\"padding:3px;\">\n"); echo("<td width=\"180px\" class=\"contact_field\">\n\n"); echo("<a href=\"mailto:" . $row['Email'] . "\">" . $row['Name'] . "</a>\n\n"); echo("</td>\n"); echo("<td class=\"contact_field\" align=\"center\">\n\n"); echo($row['Extension'] . "\n\n"); echo("</td>\n"); echo("<td class=\"contact_field\" align=\"center\">\n\n"); echo($row['Status'] . "\n\n"); echo("<a href=\"http://www.intertraffic.com" . $row['Status'] . "\">" . $row['Name'] . "</a>\n\n"); echo("</td>\n"); echo("</tr>\n"); } } ?>
×
×
  • 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.