Hi everyone.
I am trying to write an Javascript live search engine.
I found this simple program on the w3 website:
[url]http://www.w3schools.com/php/php_ajax_livesearch.asp
It is an AJAX search engine where all of the results are stored in an XML file.
I would like it to basically load my results from my MySQL database, but you can’t pass PHP variables through an XML document.
I tried this (and it didn’t work):
[CODE]<pages>
<link>
<title><?php echo $row[‘title’]; ?></title>
<url><?php echo $row[‘url’]; ?></url>
</link>
I also tried:
[CODE]
<?php echo ”
<pages>
<link>
<title>”.row[‘title’].”</title>
<url>”.row[‘url’].”</url>
</link>
</pages>”; ?>
It just prints the php phrase but won’t echo the string.
Is there a way or alternative to do this?
Thanks
Peter