close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

I want to filter a recordset by a deabasket variable

Thread began 1/03/2014 3:29 am by John Langer | Last modified 1/09/2014 10:00 am by John Langer | 2045 views | 13 replies

John LangerBeta Tester

Almost there

I've worked out how to get each individual course and then each teacher of that course printed on screen. Like this:

<?php while (!$DEAbasket->EOF()) { ?>

Course ID: <?php echo $DEAbasket->DisplayInfo("ID"); ?><br>
<?php $_GET['DEAbasketID'] = $DEAbasket->DisplayInfo("ID");
$colname_rsCourse = "40";
if (isset($_GET['DEAbasketID'])) {
$colname_rsCourse = $_GET['DEAbasketID'];
}
mysql_select_db($database_connDeaLearning, $connDeaLearning);
$query_rsCourse = sprintf("SELECT CourseID, CourseName, courseTeacher1, courseTeacher2, courseTeacher3, UserEmail FROM course INNER JOIN users ON courseTeacher1 = UserID OR courseTeacher2 = UserID OR courseTeacher3 = UserID WHERE CourseID = %s", GetSQLValueString($colname_rsCourse, "int"));
$rsCourse = mysql_query($query_rsCourse, $connDeaLearning) or die(mysql_error());
$row_rsCourse = mysql_fetch_assoc($rsCourse);
$totalRows_rsCourse = mysql_num_rows($rsCourse);?>
Course name: <?php echo $row_rsCourse['CourseName']; ?><br>
Course Teacher 1: <?php echo $row_rsCourse['courseTeacher1']; ?><br>
Course Teacher 2: <?php echo $row_rsCourse['courseTeacher2']; ?><br>
Course Teacher 3: <?php echo $row_rsCourse['courseTeacher3']; ?><br>

<?php $colname1_rsTeachersEmail = "7";
if (isset($row_rsCourse['courseTeacher1'])) {
$colname1_rsTeachersEmail = $row_rsCourse['courseTeacher1'];
}
$colname2_rsTeachersEmail = "9";
if (isset($row_reCourse['courseTeacher2'])) {
$colname2_rsTeachersEmail = $row_reCourse['courseTeacher2'];
}
$colname3_rsTeachersEmail = "-1";
if (isset($row_reCourse['courseTeacher3'])) {
$colname3_rsTeachersEmail = $row_reCourse['courseTeacher3'];
}
mysql_select_db($database_connDeaLearning, $connDeaLearning);
$query_rsTeachersEmail = sprintf("SELECT UserID, UserEmail, UserFirstName FROM users WHERE UserID = %s OR UserID = %s OR UserID = %s", GetSQLValueString($colname1_rsTeachersEmail, "int"),GetSQLValueString($colname2_rsTeachersEmail, "int"),GetSQLValueString($colname3_rsTeachersEmail, "int"));
$rsTeachersEmail = mysql_query($query_rsTeachersEmail, $connDeaLearning) or die(mysql_error());
$row_rsTeachersEmail = mysql_fetch_assoc($rsTeachersEmail);
$totalRows_rsTeachersEmail = mysql_num_rows($rsTeachersEmail);?>

<?php do { ?>
Teachers email: <?php echo $row_rsTeachersEmail['UserEmail']; ?><br>
<?php } while ($row_rsTeachersEmail = mysql_fetch_assoc($rsTeachersEmail)); ?>
<?php $DEAbasket->MoveNext();?><br>
<?php }?>

That last bit
<?php do { ?>
Teachers email: <?php echo $row_rsTeachersEmail['UserEmail']; ?><br>
<?php } while ($row_rsTeachersEmail = mysql_fetch_assoc($rsTeachersEmail)); ?>

gives me the emails. The whole thing gives me the emails needed for each course in a loop.

Now all I need to work out (and at the moment I haven't a clue) is how to get those emails into the BCC field of the email when they are not in a recordset.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...