|
Posted by UKuser on 02/04/06 15:50
I'm sure this is something really simple, but the below code isnt
returning my basic mySQL results - I know the data is in there, and if
I use a value instead of $price in PHPbuilder it does return a value.
Any thoughts?
############
<HTML>
<TITLE>test lookup</TITLE>
<form method="post" action="test2.php">
<?php
function check_mysql()
{
if (mysql_errno() > 0)
{
die("<BR> MySQL error " . mysql_errno() . ": " .
mysql_error());
}
}
$db = mysql_connect("coconia.net", "nana46_nana46", "my_password");
if (!$db)
{
die("Failed to open connection to MySQL server.");
}
mysql_select_db("nana46_nana46");
check_mysql();
if(!isset($id))
{
$id=0;
}
function result_get()
{
$query = "SELECT result FROM fig_lookup WHERE $price BETWEEN
lowerval AND upperval";
$result = mysql_query($query);
check_mysql();
}
?>
<input type="text" name="price">
<input type="submit" value="hit me">
<input type="text" name="outcome" <?php echo "VALUE=\"$result\"" ?>>
</form>
Navigation:
[Reply to this message]
|