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

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

problem with GROUP BY and ORDER BY
i usually use this query to display the last 10 entries from a sql table:

Code: $query = &quo

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

How do I send data using an html link
Hi

If I have
<a href="main_file.php">

How do I send data t

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Open browser page depending on XML results
Hello,

I have some PHP code that sends webbased from data to an external url ( in the form of

extending tidy
I have problem with type-hinting and extending tidy. This code creates error:
Code: class cMyTidy

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if t

ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients

The

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