$dbQuery="select id, name from artists where name like '$keyword%' order by name asc limit 15";
$dbResult=mysql_query($dbQuery);
echo mysql_num_rows($dbResult)."\n";
while ($dbRow=mysql_fetch_array($dbResult)) {
// for each artist, return the number of albums belonging to that artist
// use a separate query here to obtain the number
// return the number after the artist's name in the echo statement, separated with a '^' (1b)
echo $dbRow["id"]."^".$dbRow["name"]."\n";
Have this code and as you can see i have to write another dbquery that will display the number of albums an artist has. I also have to modify this piece of code
function showArtists() {
if (ajaxObject.readyState==4) {
var artistsArray=ajaxObject.responseText.spl…
var numArtists=artistsArray[0];
var htmlStr="";
for (var i=1; i<=numArtists; i++) {
var artistDetails=artistsArray.split("^")…
htmlStr+="<div onmouseover='javascript:suggestOver(this… ";
htmlStr+="onmouseout='javascript:sugge… ";
htmlStr+="onclick='javascript:setArtis… ";
// add the number of albums in brackets after the artist's name in the next line (1b)
htmlStr+="class='suggest_link'>" + artistDetails[1] + "</div> ";
Anyone know how i write this, ive tried a few things but when i try it on the webpage it stops the ajax auto fill when typing.