I am just learning PHP/MySQL, so please forgive if this is a
ridiculously lame question.

I have developed a small web app to simply display information from the
database.  The page will refresh itself every 60 seconds (plus the time
it takes to perform the refresh itself).  The data in the db is updated
every 10 minutes.  This arrangement runs fine until the page refresh
happens during the database update.  When that happens, it will display
the 1st line for the html header <!DOCTYPE HTML PUBLIC and that it!  I
am dead in the water because the refresh meta-command in the html is not
loaded.  Being new, I wrote this very close to the book I was following
and thought I had everything I need so PHP would generate an error
message.  But all I get is <!DOCTYPE HTML PUBLIC.   Note the "die()"
function in the code below.  Also the showerror() function is basically
a wrapper around a die() function

I would appreciate any help as to why I am not getting an error message
as well as any ideas as to the root problem.  I suspect some type of db
locking issue.

Below is what I believe is the pertinent code.  I am using EasyPHP 1-8
(for Windows) which is made up of :

Apache 1.3.33
PHP 4.3.10
MySQL 4.1.9

------------------------------------------------------------------------
--------

<!DOCTYPE HTML PUBLIC

<?php
 require_once "HTML/Template/IT.php";
 require "dbInb.inc";

 // Connect to the MySql server
 if (!($connection = @ mysql_connect($hostname, $username, $password)))
  die("Cannot connect");
 
 if (!(mysql_select_db($databaseName, $connection)))
  showerror();

 // Create a new template, and specify that the template files are
 // in the subdirectory "templates"
 $template = new HTML_Template_IT("./templates");

 // Load the template file
 $template->loadTemplatefile("Inbounds.tpl", true, true);
 
  
 // Run the OVERDUE query on the connection
 if (!($result = @ mysql_query("SELECT * FROM tblinbounds WHERE
batch_in_id = (SELECT batch_in_id FROM tblbatch_in ORDER BY batch_in_id
DESC LIMIT 1) AND ((del_date < DATE_FORMAT(NOW(), '%m/%d/%y')) OR
(IsEmpty(del_date))) ORDER BY del_date, del_time", $connection)))
  showerror();
 while ($row = mysql_fetch_array($result))
 {
  // work with the record block
  $template->setCurrentBlock("OVERDUE");
  // Assign the row data to the template placeholders
  $template->setVariable("VENDOR", $row["vendor"]);
  $template->setVariable("DESCRIPTION", $row["desc"]);
  $template->setVariable("CARRIER", $row["carrier"]);
  $template->setVariable("TRAILER", $row["trailer"]);
  $template->setVariable("DOCK", $row["dock"]);
  $template->setVariable("DELDATE", $row["del_date"]);
  $template->setVariable("DELTIME", $row["del_time"]);    
  // Parse the current block
  $template->parseCurrentBlock();
 }
.
.
.
.
. (More blocks like the OVERDUE block above and that's it.)


**********************
** LEGAL DISCLAIMER **
**********************

This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.

Reply via email to