Icon View Incident Report

Serious Serious
Reported By: Mark Ott Nilsen
Reported On: 6/28/2019
For: Version 2.31 Build 6
# 4753 PHP Extension Not Loading Parameters Properly

I use the code from the examples, and I get the following error:

Fatal error: Invalid parameter type for edb_prepare (1) in /var/www/html/test.php on line 12

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$con = edb_connect("type=remote;charset=Ansi;address=address;port=port;uid=user;pwd=password;database=Database");
if (!$con)
 {
 die("Could not connect: " . edb_errmsg());
 }

$cmd = edb_prepare($con,"SELECT * FROM customers WHERE ActivityBy=:Name"); <- This line is #12
edb_setparam($cmd,"Name","Malik");
$cursor = edb_execute($cmd);

echo "<table border=\"1\" cellpadding=\"3\">";

echo "<tr>";

// Dump out the column headers

for ($i = 0; $i < edb_colcount($cursor); $i++)
   {
   $colinfo = edb_colinfo($cursor,$i);
   echo "<td>" . $colinfo["Name"] . "</td>";
   }

echo "</tr>";

// Now dump out the rows

while (!edb_eof($cursor)):
   echo "<tr>";
   for ($i = 0; $i < edb_colcount($cursor); $i++)
      {
      $col = edb_getcol($cursor,$i);
      if (is_null($col))
         echo "<td>NULL</td>";
      else
         echo "<td>" . $col . "</td>";
      }
   echo "</tr>";
   edb_next($cursor);
endwhile;

echo "</table>";

edb_disconnect($con);
?>



Comments Comments
The problem was introduced during some 64-bit changes and resulted in the parameter loading code over-incrementing a pointer by 12 bytes, thus causing any calls with more than one parameter to fail.


Resolution Resolution
Fixed Problem on 7/2/2019 in version 2.31 build 7


Products Affected Products Affected
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial

Image