User Profile
Collapse
-
thanks for the help -
its a web form with a sequence of questions (output power being one of them)....if the user chooses a certain value (eg:0-25 W), then i include it in my query and filter the results based on 0-25 W...if user chooses N/A, then i return all results...the following code works:
if ((($OutputPower == '0-25 W') ||($OutputPower == '25-50 W'))
{
$sql = "SELECT * FROM $tname1 WHERE `Output Power` = '$OutputPower'" .(($ICSupply...Leave a comment:
-
not quite...followi ng is the query when OutputPower == N/A:
sql = "SELECT * FROM $tname1 WHERE 1"
when i run this query directly on the database through phpMyAdmin, it returns all the rows, which is what should be happening.......Leave a comment:
-
php mysql query returning empty set
the following query is returning an empty set and i am not sure why:
if (($OutputPower == '75') || ($OutputPower == 'N/A'))
{
sql = Select * from $Tname1 WHERE 1".(($OutputPow er != 'N/A') ? "AND `Output Power` = '$OutputPower'" : "" );
so essentially it includes Output Power in the query as long as the user did not enter N/A.
it works fine if i just have:
sql...
No activity results to display
Show More
Leave a comment: