🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.golive.dynamic.content
Article #86

Re: NateMail and Dynamic Recipients

#86
From: Jeremy_M._Cox
Date: Sun, 18 Jul 2004 17:24
41 lines
1941 bytes
I added a db connect and query at the top of the script to pull out the IDs and email address from the db. Keep getting a parsing error.

Here is the script I added to the top of the page inside the php open tag.

require_once("../config/include/db_fns.php")

$conn = db_connect();
if (!$conn)
return 'Could not connect to database server - please try later.';

mysql_select_db('tqeg');
$query = "select personnel_ID, personnel_email from personnell";
$result = mysql_query ($query);
$num_results = mysql_num_rows($result);

I then placed this inside the recipient line

for ($i=0; $i <$num_results; $i++) {

$row = mysql_fetch_array($result);
$thisID =
$recipients[htmlspecialchars(stripslashes($row['personnel_ID']))] = stripslashes($row['personnel_email']);
}
can someone look at this and tell me if its wrong? Would this even work in the ProcessForm script at all?

Here is the db_fns.php file from the require

< ?php function db_connect() { $db = mysql_pconnect('localhost', 'username', 'password'); if (!$db) return false; } ? >

I get a parse error on line 5 in the process form script.

This is the line 5
$conn = db_connect();

I got rid of the this code block which is:

$conn = db_connect();
if (!$conn)
return 'Could not connect to database server - please try later.';

and I still get a parse error.
Technical Details
Message-ID: <3bb50e6f.0@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3bb50e6f.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11ffd2,46f9e22d05d81f7c
X-Google-Attributes: gid11ffd2,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Jeremy_M._Cox@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.golive.dynamic.content
Subject: Re: NateMail and Dynamic Recipients
Message-ID: <3bb50e6f.0@webx.la2eafNXanI>
Date: Sun, 18 Jul 2004 10:24:02 -0700
References: <3bb50e6f.-1@webx.la2eafNXanI>
Lines: 52
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit