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

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

Lets say you h

mysql select query problem
how can i select multiple fields from multiple table in one query like

i have table name t1 a

Problem with variable declaration in switch statement
Hello, I am having some trouble assigning a value to a variable inside a switch statement. What I a

mysql timestamp manipulation
How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:

from

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

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

array empty
Hiya peeps,

Ok here is the codes.

order.php

Code:

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