Re: Selecting data works "SOMETIMES" ! with the code
Here is a code snipet:
[php]
//....
$sqlListUrl = "SELECT pesma, url FROM nostalgija WHERE pesma LIKE '%" . mysql_real_escape_string($st) . "%'";
$resultListUrl = mysql_query($sqlListUrl );
while ( $row = mysql_fetch_array($resultListUrl) ) {
echo "<a href='".$row["url"]."'>" . $row["pesma"] . "</a><br>";
}
//....
[/php]
As you can see I replaced " with ', after LIKE ...
mysql_real_escape_string() function is used to escape strings (is a basic protection for sql injection)
Subject
Written By
Posted
Re: Selecting data works "SOMETIMES" ! with the code
August 23, 2005 08:07AM
September 01, 2005 12:58AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.