This topic is locked
[SOLVED]

 Problem with function in PHPRunner 7.1 21342

5/14/2014 11:54:09 AM
PHPRunner General questions
A
Anapolis author

I just made a few minor stylistic changes to a project that has been up for 2 months composed with PHPRunner 7.1 20946.
I opened this same project today in build 21342 and made a few stylistic changes and uploaded.
Now an online View fails with a msqli error. Apparently this value cannot be returned now and it is used in my where query.
global $dal;
$myid=$data["id"];
This has been inside my Custom Query for my index field on the List page of Calendar Records. The "id" field has not changed its characteristics. Hundreds of rows should be showing up as always. This is where it now fails.... the query no longer completes with a lookup to the value of this row's "id".
$myid=$data["id"];
$strSQLExists = "SELECT calcalendarid from reports where calcalendarid=".$myid."";
Yesterday this worked flawlessly. I know the phpfunctions.php file is involved because I tried to make modifications to see if I could retrieve this LIST field data and it is the phpfunctions.php file that is uploaded again.

A
Anapolis author 5/14/2014

I have tried using the $data["id"] directly, I have also tried surround it with single quote marks as in = '" .$data["id"] . "'

What I know has changed with 7.1 21342 is my ability to grab the numeric id value from each row on this list page.
I keep getting this error : mysqli_query() expects parameter 1 to be mysqli, null given
the phpfunctions.php file shows this --

* return custom expression

* @intellisense

*/

function CustomExpression($value, $data, $field, $ptype, $table="")

{

global $strTableName;

if(!$table)

$table = $strTableName;

if($table=="calcalendar" && $field=="id")

{

global $dal;

$myid=$data["id"];
$strSQLExists = "SELECT calcalendarid from reports where calcalendarid= '".$data["id"]."'";

$rsExists = db_query($strSQLExists,$conn);

$mydata=db_fetch_array($rsExists);

if($mydata)
A
Anapolis author 5/14/2014

It is now working.
Since using PHPR 7.1 21342 I had to change my code to this ... to end errors and get back my View.

global $dal;
$value = $data["id"];

global $conn;

$strSQLExists = "SELECT calcalendarid from reports where calcalendarid = '".$value."'";

$rsExists = db_exec($strSQLExists,$conn);


I am not including the rest of the Custom Query... just the part that kept creating the error.
I could not assign another variable name to $data["id"]
I had to stick with $value = $data["id"];
Up until today any other variable name worked.
And I had to put the single quote-double quote marks '" and "' back in.
And I had to use db_exec instead of db_query.
It does not make sense why but there it is.