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

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

cURL proxy
Okay here is the thing... i know how to add proxys

Code: curl_setopt($ch, CURLOPT_PROXYTYPE,

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

PHP / MySQL Associative Multidimensional Array:
Hello.

I have data in a MySQL Table that adheres to the below: (note, no index, could add if

JQuery, Masterpage, and Control issue
Hey everyone, I am using JQuery in several sites so I thought it would be best to place the library

why this query can delete duplicates ?
why this query can delete duplicates ? Anybody can give me the detailed explanation ?

Tha

Help, Base64 encoding url and decoding server side.
Hello everyone, i have a website with videos and games and also provide an embed code which people c

Ball movement
I want to move a ball from one point to another and it should hit a group of balls at the other end

WS-Security PL/SQL Forms
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
PL/SQL Release 10.2.0.2.0 - P

Extract specific information from a PHP Multidimensional Array
Howdy! I've racked my brain over this for 24 hours now. I think it's time I asked for help. I'm lear

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