troubleshooting Question

MySQL/Php query only returning one record?

Avatar of edavo
edavoFlag for United States of America asked on
12 Comments1 Solution369 ViewsLast Modified:
The code below is returning only ONE record. I want it to return ALL records that meet the query... It should return ALL records whose "team" field equals the value of $tm...

The $tm value is being passed through the url string and grabbed via a GET statement. I echoed the $tm and it is working properly.

------- code

$sql="SELECT * FROM schedules WHERE team LIKE '".$tm."' ORDER BY date";
            $result=mysql_query($sql) or die(mysql_error());
                  echo '<tr><td>';
              echo $rows['opp'];
              echo '</td><td>';
                  echo $rows['loc'];
                  echo '</td><td>';
                  echo $rows['date'];
                  echo '</td></tr>';

Please review and help...

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros