Jump to content

AJAX database issue


sarris
 Share

Recommended Posts

You can't return an array object, you would need to return it as a string and use Javascript to split up the string into an array. So in PHP you would use implode to join an array into a string, like this:

$array_str = implode("**||**", $array);

That will convert the array into a string with "**||**" separating each array element. Then you get the string in Javascript and use split to change it back to an array:

var str = new String(return_data);var arr = str.split("**||**");

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...