foreach help.


Posted on 16th Feb 2014 07:03 pm by admin

Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my code is correct:

Code: $sql = "SELECT email from mail_list where subcribed = "Y" ";

$rs = mssql_query( $sql, $conn )
or die( "Err EXE" );
$row = mssql_fetch_array( $rs );

foreach($row["email"] as $email)
{
$to = "$email";
$re = "Newsletter";
$msg = "The latest Newsletter is ready for download nnThank You";
$headers = "From: No-Reply@doamin.com rn";
}
Hard to test as I dont want to start sending out rouge emails

Many Thanks

No comments posted yet

Your Answer:

Login to answer
85 Like 44 Dislike
Previous forums Next forums
Other forums

Unable to display contents in Second Drop Down Box
Hi All,

What I am trying to do is 2 dependent drop down boxes and when user selects su

Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for eve

Uploading Filetypes and placing them in seperate folders.
Hello,

first post , and asking for help im afraid. Very new to PHP, was making good progress

Standard DES encryption script?
Can anybody point me to a tutorial or a short script that shows how to encrypt some text with salt i

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

PHP onsubmit in the form not going to the fuction.
I have a form through ‘onsubmit’ calling a function validation(). But not going to the

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

Error in Configure System Landscape Directory phase
Hi

We are getting the error in Configure SLD phase ( 41 of 44 phase).

Please f

Hits this week counter
I have a counter on my site that tracks hits, IP's, etc. into a mySQL database. It also includes the

Simple MySQL script is not working
Hey guys,

Just familiarizing myself with PHP and MySQL. I am following along in the O'Reilly

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash