asked on
<?php
if(empty($_GET['topic'])) {
exit();
}
$topic = $_GET['topic'];
$link = mysql_connect("localhost","username","password");
mysql_select_db("database_name");
$query = "SELECT item FROM info WHERE cat = '".mysql_real_escape_string($topic)."'";
$result = mysql_query($query);
if($result) {
$items = array();
while($row = mysql_fetch_array($result)) {
$items[] = $row['item'];
}
$string = implode(',',$items);
echo $string;
}
?>
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
set objConn = CreateObject("Adodb.Connec
objConn.Open strYourConnectionStringHer
set objRS = objConn.Execute("SELECT item FROM info WHERE cat = '" & replace(request("topic"),"
if not(objRS.EOF) then
do while not(objRS.EOF)
response.write(objRS("item
objRS.MoveNext
loop
else
response.write("No Records Found")
end if
set objRS = nothing
objConn.Close
set objConn = Nothing