an...@my... wrote:
>Dear list
>
>Been using PHPLib a few years back and started using it again for a project
>since the DB class, auth and sessions are just so easy and effective to use.
>
>
>Im running into a problem however. I have used FastTemplates on my pages and
>found that where I have a Insert statement that I try to do with :
>
>$squery = "INSERT INTO auto_messages(message_name,auto_messages) VALUES
>('$Message_Name', '$Message')";
>$aDb = new DB_oi_ct;
>$aDb->query("$squery");
>
>
>...as an example, this statement however always (on all pages where I would
>do some insert into the db) in one valid row of data entered and one blank
>line (Never just one entry) I thought that it might be fastTemplates and
>swithed over to phplib's own template but still got one valid db insert and
>one blank insert.
>
>I have also used a Mailing class to send mail and get the same thing, 2
>emails arrive - one with values and one blank.
>
>I tried to print the query to see what the query look like and only one
>query (correct) displays. Ive enabled phplib debug echo and it also displays
>one query?
>
>
>My current environment is :
>
>Windows XP sp2
>Installed phpdev423 - from firepages.com.au
>
>I have tried to play with the php.ini settings for track_vars, magic quotes
>etc (as per phplib doc) and restarted apache. I still get blank database
>inserts and blank emails.
>
>Also note if I take the template out of the picture and only use the DB
>object then everything works fine - then my insert query results in one
>entry only with valid values etc?
>
>
Hmm... I can't say that I've ever run into a problem like that. It
sounds like the templating system might be causing the query to execute
twice, with one of the execution's output being discarded or something.
However, I can't really be sure. Since you mentioned that it works fine
when you don't use templates, I'd look for the bug there in any case--it
sounds like the problem might be in how you've implemented the
templates, since you said that the bug occurs both with PHPlib Templates
and FastTemplates. Unfortunately, I don't use a templating system on my
projects, so I can't offer any more clues as to what might be causing that.
--
___________________________
Nathaniel Price
|