PHP Classes

results array to js

Recommend this page to a friend!

      PHP Array to Javascript  >  All threads  >  results array to js  >  (Un) Subscribe thread alerts  
Subject:results array to js
Summary:throws error
Messages:1
Author:Randy Ahn
Date:2006-10-20 17:41:40
 

  1. results array to js   Reply   Report abuse  
Picture of Randy Ahn Randy Ahn - 2006-10-20 17:41:40
Hello:
I'm not sure if I'm using the class correctly, but I just tried to convert a results array into js using this class, using the easiest example in example.php Thanks.

My code:
$result = mysql_query($sql) or die(mysql_error());
$easyconvert = new array_to_js();
$easyconvert->add_array($result, "myarray");
echo $easyconvert->output_all();

And the error:
Warning: Invalid argument supplied for foreach() in /home/username/public_html/myPath/class_arraytojs.php on line 13