Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Newbie in need of help with MySQL and PHP


StevieMac - 5:48 pm on Sep 1, 2004 (gmt 0)


Sorry for such a lame question......

I have searched up and down on this site for ideas on how to fix this, however I just cant seem to find an answer.

I want to take a form and POST to a script and return rows from a sql database. From what I am quering on, it has duplicate entry's however, they are not primary.

<html>
<body>

<form name="wifi" method="POST" action="results.php">
<p> SSID: <input name="ssid" type="text" id="ssid">
<p><input type="submit" name="submit" value="submit">
</form>
</body>
</html>

<?
$host = "localhost";
$user = "username";
$pass = "password";
$dbname = "database";
$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");
mysql_select_db($dbname);
$sql = "select * from tablename where SSID = " . $_POST['SSID'] . "'";

$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
echo "<p>",$row['SSID'],": ",$row['BSSID'];
}
?>

When I input something in the textbox and hit submit, I just get a blank screen. I did have an echo as seen in a previous post, and it shows the echo, but nothing else.

Please, any help would be appreciated.....


Thread source:: http://www.webmasterworld.com/php/4932.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com