This topic is locked
[SOLVED]

 mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given

4/15/2014 9:19:47 AM
PHPRunner General questions
A
Anapolis author

I have a table called myemail that has an index column and then 3 columns in varchar or text type named tostuff, subject, body.
When those fields are retrieved I have the parts of an email ready to loop through and send using the runner_email function.
This is the code sitting in the List page Custom Query Events:


global $dal;
$sql = "SELECT * FROM `myemail`";
$rstmp = CustomQuery($sql);

if($rstmp === FALSE) {

die(mysql_error());

}

while ($datatmp = db_fetch_array($rstmp))

{
$to = $datatmp["tostuff"];

$subject = $datatmp["subject"];

$body = $datatmp["body"];

$from = "mygmail@gmail.com";

$ret=runner_mail(array('to' =>$to,'subject' =>$subject, 'htmlbody' =>$body,'charset' => 'UTF-8', 'from'=>$from ));



}


I have tried different connection methods and different PHPRunner code examples. I figured Jane's was sure to work.
This is adapted from Jane's example in the Tips and Tricks Forum.

Jane's Example
But I keep getting this error:
mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given
Same error with this example from the PHPRunner documentation on mass emails (never more than 7 or 8 in actual use on a Dedicated Server )--

global $dal;
//select emails from Users table
$tblUsers = $dal->Table("myemail");
$rs = $tblUsers->QueryAll();
while ($data = db_fetch_array($rs))
{

$to =$data["tostuff"];

$subject = $data["subject"];

$email =$data["body"]."\r\n";

$from="mgmail@gmail.com";
$msg="Check what's hot this season";
$subject="Monthly newsletter";
$ret=runner_mail(array('to' => $to, 'subject' => $subject, 'body' => $email, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"]."
";
}
Sergey Kornilov admin 4/15/2014

If you have a valid support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. This is the only way to find what is wrong.

A
Anapolis author 4/15/2014

I have discovered that both script examples ARE sending Emails!
But the page where the Email script is located does not load past this ugly stuff;
Technische Information

Fehlertyp 2

Fehlerbeschreibung mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given

URL derboxenstopp.de/myemail_list.php?

Fehlerdatei /myhomepages/98/x66664054/htdocs/mywebsitefolder/include/dbconnection.my.mysqli.php

Fehlerzeile 101

SQL Abfrage select * from myemail
actual Select currently --
global $dal;
$tblUsers = $dal->Table("myemail");
$rs = $tblUsers->QueryAll();
while ($data = db_fetch_array($rs))