Jump to content


Photo

*SOLVED* PHP doesn't obey me


  • Please log in to reply
1 reply to this topic

#1 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 06 May 2006 - 09:32 PM

<?php
    if (isset($_POST['query'])) {
                $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM usbextreme WHERE name LIKE '%$query%' OR system LIKE '%$query%' OR postedby LIKE '%$query%'"),0);
                if ($total_results!=0) {
                echo '<span class="style79">Searched results:</span> <span class="style80">'.$total_results.' - <a href="index.php">Reset</a></span'; } else { echo '<span class="style79">No results</span> - <a href="index.php">Reset</a>'; } } 
                
    elseif (isset($_POST['select'])) {
                if ($_POST['select']="today") {
                $now=date(dmy);    
                $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM usbextreme WHERE ins_date LIKE $now"),0);
                if ($total_results!=0) {
                echo '<span class="style79">Filtered results:</span> <span class="style80">'.$total_results.' - <a href="index.php">Reset</a></span>'; } else { if (!isset($_POST['select'])) { echo '<span class="style79">No results</span> - <a href="index.php">Reset</a>'; } } } }
                
                else {
                $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM usbextreme WHERE system LIKE '$filter' OR work_status LIKE '$filter'"),0);
                if ($total_results!=0) {
                echo '<span class="style79">Filtered results:</span> <span class="style80">'.$total_results.' - <a href="index.php">Reset</a></span>'; } else { echo '<span class="style79">No results</span> - <a href="index.php">Reset</a>'; } }
?>

[a href=\"http://infocenter.awardspace.com/inter/ps2ub/index.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/index.php[/a]

If you enter this link, you will find something at the bottom of the page like this "No results - Reset", that shouldn't be there without searching the db or using the filter. For any reason, I'm not being able to make it disappear. Please check the code.

#2 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 06 May 2006 - 09:50 PM

Dont bother replying, I figured out I have many problems in my code that doesn't let this work properly.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users