<?php
$query = mysql_query("Select id, name From table");
while($row = mysql_fetch_array($query)) {
echo $_GET["jsoncallback"] . '(<option value='.$row['id'].'>'.$row['name'].'</option>)';
}
?>
When I echo result, it is error, how to fix it?
Since you didn’t write exactly what you’re trying to do, i’m guessing you’re trying to return a list of HTML options that a JS callback function will place in your document.
try this:
This will first create all the options as a string, and only then build the callback.