Advertisement

04.13.2007 at 10:59AM PDT, ID: 22510282
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Problem with PHP5 and mySQL 5

Asked by dumpsterdivingdave in PHP Scripting Language, PHP and Databases, MySQL Server

Tags: , , , ,

I recently moved a site that I had designed from a Windows box running PHP 5 and MySQL 5 to a linux box running the same.  However, When I attempt to use the login (which works perfectly on the windows box), I get the following error lines printed out:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tshclan/public_html/recruiting/validate.php on line 36

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/tshclan/public_html/recruiting/validate.php on line 37

Warning: array_values() [function.array-values]: The argument should be an array in /home/tshclan/public_html/recruiting/validate.php on line 38

Here is a copy of the source:
  <?php
      $SubUser = $_POST['User'];
      $SubPass = $_POST['Pass'];
      
      $db = mysql_connect("localhost", "*****", "*****", true);
      mysql_select_db("tshclan_rct");
      $query = "SELECT * FROM Users WHERE Users.User = '" . $SubUser . "'";
      $result = mysql_query($query);
      if (!$result) {
            print "Error with Query";
      }
      $num_rows = mysql_num_rows($result);
      $row = mysql_fetch_array($result);
      $values = array_values($row);
      $dbUser = $values[0];
      $dbPass = $values[2];
      $dbDiv = $values[4];
      $dbRank = $values[6];
      if ($dbDiv == "BF2") {
            $Div = "Battlefield%202";
      }
      if ($dbDiv == "COD2") {
            $Div = "Call%20of%20Duty%202";
      }
      if ($dbDiv == "BF2142") {
            $Div = "Battlefield%202142";
      }
      if ($dbDiv == "ALL") {
            $Div = "NULL";
      }
      if ((($dbUser == $SubUser) && ($dbPass == $SubPass)) || (($SubUser == $dbUser) && (md5($SubPass) == $dbPass))) {
            setcookie("User", $dbUser, time()+3600);
            setcookie("Pass", $dbPass, time()+3600);
            setcookie("Div", $dbDiv, time()+3600);
            setcookie("Rank", $dbRank, time()+3600);
            print "<h1>Validated!</h1>";
            //$link = "http://www.tsh-clan.com/recruiting/main.php?user=" . $dbUser;
            if ($Div == "NULL") {
                  $link = "http://www.tsh-clan.com/recruiting/main.php";
            } else {
                  $link = "http://www.tsh-clan.com/recruiting/main.php?Div=" . $Div;
            }
            print $link;
            header("Location: " . $link);
      } else {
            print "<p>You could not be validated at this time.  Please check the username and password and try again</p>\n";
      }
      
      
      //print $SubUser . "..." . $SubPass;
?>

Any ideas?Start Free Trial
[+][-]04.13.2007 at 12:25PM PDT, ID: 18907925

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2007 at 12:25PM PDT, ID: 18907927

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2007 at 04:20PM PDT, ID: 18909094

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.13.2007 at 09:45PM PDT, ID: 18909751

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 04:27AM PDT, ID: 18910469

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 09:26AM PDT, ID: 18911221

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 10:33AM PDT, ID: 18911374

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 11:47AM PDT, ID: 18911545

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 12:44PM PDT, ID: 18911691

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 06:58PM PDT, ID: 18912571

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 07:02PM PDT, ID: 18912583

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2007 at 09:39PM PDT, ID: 18912840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2007 at 04:28PM PDT, ID: 18915080

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2007 at 10:53PM PDT, ID: 18916061

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, PHP and Databases, MySQL Server
Tags: php5, 5, checking, header, mysql
Sign Up Now!
Solution Provided By: hernst42
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.16.2007 at 11:59AM PDT, ID: 18919929

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44