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

pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n

Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.

I have maxminds geoip lite installed and i

Handling text changed in text box control using Ajax
I need to create a web form with a text box control. When someone types text into the textbox I nee

Remove Rows From Database ad
Hi All,

I have this:

Code: [Select]<?php
session_start();
include('../com

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..

Lets say you h

SAP BCS. BPS
Hi all,

I am seeking reading note on the following in BW

BCS, BPS
ADVANCE

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

need help with date function
i have following form for date

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Entering Data Problem
Code: $result = mysql_query("SELECT * FROM flights");
while ($row = mysql_fetch_array($

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