Can anyone tell me whats wrong with this code? The variables are being past
from other page and the $connection is ok as is $result. this query should
return 6 rows.
the error message I get is "Warning: mysql_fetch_row (): supplied argument is
not a valid MySQL result resource in /var/www/html"
The user selects a field from a drop down then enters the parameter to
search the field with in a input type text field then clicks a button to run
the query. I'm new at this so any help appreciated.
Bob
<?php
$SField=($_POST["SField"]);
$Parameter = ($_POST["Parameter"]);
$connection = mysql_connect(" localhost", "connection ", "pword");
print_r($Parame ter);
print_r(connect ion);
mysql_select_db ("HelpData", $connection);
$FLDquery= "select * from tblWorkstation where '".$SField." ' =
".$Parameter."" ;
$result = mysql_query($FL Dquery, $connection) ;
while ($row = mysql_fetch_row ($result))
{
for($i=0;$i<mys ql_numFields($r esult);$i++)
echo $row[$i]." ";
echo "\n";
}
?>
from other page and the $connection is ok as is $result. this query should
return 6 rows.
the error message I get is "Warning: mysql_fetch_row (): supplied argument is
not a valid MySQL result resource in /var/www/html"
The user selects a field from a drop down then enters the parameter to
search the field with in a input type text field then clicks a button to run
the query. I'm new at this so any help appreciated.
Bob
<?php
$SField=($_POST["SField"]);
$Parameter = ($_POST["Parameter"]);
$connection = mysql_connect(" localhost", "connection ", "pword");
print_r($Parame ter);
print_r(connect ion);
mysql_select_db ("HelpData", $connection);
$FLDquery= "select * from tblWorkstation where '".$SField." ' =
".$Parameter."" ;
$result = mysql_query($FL Dquery, $connection) ;
while ($row = mysql_fetch_row ($result))
{
for($i=0;$i<mys ql_numFields($r esult);$i++)
echo $row[$i]." ";
echo "\n";
}
?>
Comment