Jump to content

Code question


phpfanphp

Recommended Posts

Any idea why the code below is returning:

Search Results

 

".$fieldvalue."

"; } echo "

"; } ?>

Click here to go bck to the search page.

 

in Firefox and IE?

 

<html>
<head>
<title>Vinyl Dealers: search results</title>

</head>

<body>
<h2>Search Results</h2>
<br>
<?php

$db = mysql_connect("localhost");
mysql_select_db("vinyldealers",$db);
$query = "SELECT shops.name, shops.phone, shops.email, shops.website FROM shops WHERE name LIKE '%".$name."%'"; //% is a wilecard character. Will make the query find all inst. where $name is ...?
$result = mysql_query($query);
while ($record = mysql_fetch_assoc($result))
{
while (list($fieldname,$fieldvalue) = each ($record))
{
		echo $fieldname.":<b>".$fieldvalue."</B><BR>";
}
echo "<BR>";
}
?>

<br>
<a href'"searchbyname.html">Click here to go bck to the search page.</a>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/66771-code-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.