After like 40 minutes of troubleshooting and debugging i finally got it lol... my codes below:
<?php
require_once "config.php";
$q = strtolower($_GET["q"]);
if (!$q);
// Formulate Query
// This is the best way to perform an SQL query
// For more examples, see mysql_real_escape_string()
$query = ("select DISTINCT software_version, software_name as software_name from indexed1 where software_name LIKE '%$q%' OR software_version LIKE '%$q%'");
// Perform Query
$result = mysql_query($query);
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['software_name'];
echo '<br>';
echo "\r";
echo $row['software_version'];
echo "\n";
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>
My problem as of right now is:
while ($row = mysql_fetch_assoc($result)) {
echo $row['software_name'];
echo "<br>";
echo "\r";
echo $row['software_version'];
echo "\n";
}
I've got an autosuggest feature, and the: echo "<br>"; it does what its supposed to do and inserts a new line eg "br" into the autosuggest part, but it then inserts <br> into the textbox once submitted. how do i take care of this?