Jump to content

fja3omega

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fja3omega's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. -------------------------------------------------------------------------------------- Company: AQUALINE INTERNATIONAL, INC. Email Address: export1@aqaulineusa.com Contact Person: Ana Rodriguez Count: 22 -------------------------------------------------------------------------------------- Company: AQUALINE PRODUCTS INC. Email Address: tom@aqualinepro.com Contact Person: Tom Lukk Count: 23 -------------------------------------------------------------------------------------- Company: ARK FLOORS INC. Email Address: erica.shu@ark-floors.com Contact Person: Erica Shu Count: 24 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mailme.php on line 16 The problem is whats inside here xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------------- Company: Art's Trading Co Email Address: erica.shu@ark-floors.com Contact Person: Erica Shu Count: 25 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx its got the same email and contact person as the one listed above it. its got an ' inside Art's so that may be the problem. -------------------------------------------------------------------------------------- Company: Asia Direct Imports Email Address: richardamoore@cox.net Contact Person: Richard Moore Count: 26
  2. have you tried doing the echo inside the function?
  3. $calls ="SELECT * FROM `table2` WHERE `Company` LIKE '%$company%'"; that didn't work. I tried that already. hmmm... do i need to parse the variable? pregmatchall? i don't even know how to start with this...
  4. try this website. http://www.plus2net.com/php_tutorial/variables.php
  5. This is my code in PHP for searching two tables. It works but then an error occurs whenever $calls ="SELECT * FROM `table2` WHERE `Company` LIKE '$company'"; gets a variable data with an (') inside. Like Cow's, It's, Isn't or Don't. I've been trying the search in MySQL phpMyAdmin and it shows that with ' you need %'% to get it to show. How do i put %$var% in my $calls variable? Heres my code: <?php $count = 0; $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Database", $con); $result = mysql_query("SELECT * FROM table1"); while($row = mysql_fetch_array($result)) { $count++; $company = $row['Company']; $calls ="SELECT * FROM `table2` WHERE `Company` LIKE '$company'"; $result2 = mysql_query($calls); while($row2 = mysql_fetch_array($result2)) { $email = $row2['Email Address']; $cntper = $row2['Contact Person']; } echo "<br />--------------------------------------------------------------------------------------<br />Company: ".$company."<br />Email Address: ".$email."<br />Contact Person: ".$cntper."<br />Count: ".$count; ob_flush(); flush(); } mysql_close($con); ?> Please and Thank You...
  6. Okay... its still not working... it still stops... must be the execution time set on my server... have decided to split this into little bits... maybe split the emails by 50 email sending each run... does anyone have a clue how to automatically open a new page or redirect the page to a different page after running this kind of script? without clicking on a link or button... thank you.
  7. Hmmm... didn't even see that... thanks bulrush... $message="";
  8. okay i will try adding this to the code then... hmmm... yup its probably php execution time... had the same problem with my tables... Thank you...
  9. I'm currently trying to use this script to send email with different content to different emails. The problem I am having is that once it reaches about 90 emails it suddenly stops. I don't know if the problem is the bandwidth of the domain or the script itself. Can someone help me with this please. Thank you. $result = mysql_query("SELECT * FROM table1"); while($row = mysql_fetch_array($result)) { $email = $row['Email Address']; $company = $row['Company']; $cntperres = mysql_query("SELECT * FROM table2 WHERE `Email Address`='$email'"); while($cntperrow = mysql_fetch_array($cntperres)) { $cntper = $cntperrow['Contact Person']; } # -=-=-=- MIME BOUNDARY $mime_boundary = "----BEYOND SHIPPING----".md5(time()); # -=-=-=- MAIL HEADERS $to = $email; $subject = "MAIL for " . $company; $headers = "From: ME@ME.com\n"; $headers .= "Reply-To: ME@ME.com\n"; $headers .= "CC: ME2@ME2.com\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $message .= "--$mime_boundary\n"; $message .= "Content-Type: text/html; charset=UTF-8\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= "<html>\n"; $message .="<p>Dear <strong>"; $message .= $cntper; $message .="</strong>,</p>"; $message .= 'message1'; $result2 = mysql_query("SELECT * FROM `table1` WHERE `Email Address`='$email'"); while($row2 = mysql_fetch_array($result2)) { $message .= "message2 selected from table1"; } $message .= 'message3'; $message .= 'message4'; $message .= "<p></p>"; $message .= "</body>\n"; $message .= "</html>\n"; # -=-=-=- FINAL BOUNDARY $message .= "--$mime_boundary--\n\n"; # -=-=-=- SEND MAIL $mail_sent = @mail( $to, $subject, $message, $headers ); if($mail_sent) { echo "\nmail sent to " . $email; } else { echo "\nmail not sent to " . $email; } } Any suggestions would be greatly appreciated.
×
×
  • 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.