Jump to content

request 2 id from dBase


web_master

Recommended Posts

well, script is complecsly mailer:

 

<?php
include "../mysql_connect.php";
error_reporting(E_ERROR);
@ini_set('display_errors', '1');




include ('nxs_mimemail.inc.php');

if($_POST['email_sendto'] == "0") { $where = "WHERE `id` = '1546' AND `id` = '1' AND `email_id` = '".$_POST['email_id']."' ";}
if($_POST['email_sendto'] == "1") { $where = "WHERE `ugyfel_korlevel` = '1' ORDER BY `id` ASC" ;}

// Reload from dBase
$query_return = mysql_query("SELECT
	`email`.`email_id`,
	`email`.`email_txt`,
	`email`.`email_sendto`,
	`ugyfelek`.`id`,
	`ugyfelek`.`e_mail`,
	`ugyfelek`.`ugyfelnev`,
	`ugyfelek`.`ugyfel_korlevel`
FROM
	`email`,`ugyfelek`
".$where."
");

if(!$query_return) {
	print mysql_error();
	exit;
}


while($request = mysql_fetch_array($query_return)) {



// Reload photo
$email_photo = $request['email_id']."_email_photo.jpg";
	if(is_file($email_photo)){
		$photo_view = "<img src=\"".$email_photo."\" alt=\"\" />";
	} else {
		$photo_view = "—";
	}


// MAIL
$from	= "foliahaz@gmail.com";
$to		= $request['e_mail'];




// Embedded pictures
$image2 = "mailer_headline.jpg";
$image3 = "headline_fruits.jpg";
$image	= $email_photo;


$subject = "Hiros foliahaz kft. :: Megoldasok foliahazakhoz";
$text = $request['email_txt'];






$html ="

<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
<title>Hírös Fóliaház Kft. • körlevél</title>
<style type=\"text/css\">
<!--
body {
background: #ffdead;
}

.maintable {
width: 500px;
}

.headlinetable {
height: 64px;
}

.headlinescroll {
height: 10px;
border: solid;
border-width: 0px 1px 0px 1px;
border-color: #d6d8d9;
}

.maintd {
border: solid;
border-width: 0px 1px 1px 1px;
border-color: #d6d8d9;
vertical-align: top;
padding: 10px;
}

.footertd {
border: solid;
border-width: 0px 1px 1px 1px;
border-color: #d6d8d9;
padding: 10px;
}

.footertxt {
font-family: Georgia, \"Times New Roman\", serif;
font-size: 10px;
font-weight: bold;
color: #bcb9b8;
text-align: center;
margin: 0px;
}

.bodytext {
font-family: Georgia, \"Times New Roman\", serif;
font-size: 14px;
font-weight: normal;
color: black;
text-align: left;
line-height: normal;
margin: 0px;
}

.nomail {
font-family: Georgia, \"Times New Roman\", serif;
font-size: 8px;
font-weight: bold;
color: green;
text-align: center;
margin: 0px;
}

-->
</style>
</head>

<body>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" class=\"maintable\">
<tr>
	<td class=\"headlinetable\"><img src=\"mailer_headline.jpg\" alt=\"\" /></td>
</tr>

<tr>
	<td class=\"headlinescroll\"><img src=\"headline_fruits.jpg\" alt=\"\" /></td>
</tr>

<tr>
	<td class=\"maintd\">
	<p class=\"bodytext\">".nl2br($request['email_txt'])."</p>
	<p class=\"bodytext\"> </p>
		".$photo_view."
	</td>
</tr>

<tr>
	<td class=\"footertd\">
		<p class=\"footertxt\">
			Hírös Fóliaház Kft.<br />
			H 6000 Kecskemét<br />
			Heliport Technik-Park<br />
			Mobil: +36 30/550-9870<br />
			email: foliahaz@gmail.com<br />
			url: http://www.foliahaz.hu</p>

		<p class=\"nomail\">Leiratkozás a hírlevélről</p></td>
</tr>
</table>

</body>
</html>
";
$mimemail = new nxs_mimemail();
$mimemail->new_mail($from, $to, $subject, $text, $html);

$mimemail->add_attachment($image2, "mailer_headline.jpg");
$mimemail->add_attachment($image3, "headline_fruits.jpg");
$mimemail->add_attachment($image, $email_photo);

// Sent mail
if ($mimemail->send())
	print $request['id'].".  ".$request['ugyfelnev']."  ( ".$request['e_mail']." )<br />";
else
	print "ERROR nincs elküldve a mail!<br />";

} // end of while
?>

Link to comment
Share on other sites

Ummm. id won't be both 1 AND 1546 at the same time in any row. To retrieve the rows with id's = 1, 1546, you need to use the OR operator or use the IN() function. Assuming that id is a numeric data type -

 

WHERE id = 1 OR id = 1546

 

WHERE id IN(1,1546)

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.