topical media & game development

talk show tell print

professional-ajax-03-Fallback-Patterns-Cancel-Pending-Requests-ViewComment.php / php

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  <html xmlns="" xml:lang="en" lang="en">
      //database information
      sDBServer = "your.database.server";
      sDBName = "your_db_name";
      sDBUsername = "your_db_username";
      sDBPassword = "your_db_password";
      commentId = _GET["id"];
      //create the SQL query string
      sSQL = "select Name,Message from BlogComments where CommentId=commentId";
      oLink = mysql_connect(sDBServer,sDBUsername,sDBPassword);
      @mysql_select_db(sDBName) or sStatus = "Unable to open database";
      if(oResult = mysql_query(sSQL) and mysql_num_rows(oResult) > 0) {
          aValues = mysql_fetch_array(oResult,MYSQL_ASSOC);
          <p>Comment from <?php echo aValues["Name"] ?>:</p>
          <p><?php echo aValues["Message"] ?></p>

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.