I am getting odd query results. I should be getting a list of students, over 100, but I am only getting 3. Here is my connection and sql, please help. It works excellent on PC, but the client is using a Mac. Please advise. On PC, I get all 100 rows, but on the Mac the client gets only 3 rows. With the exact same code.

<?php  $conn=odbc_connect('sitepoint','sitepoint','sitepoint'); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT fname, lname FROM table1"; $rs=odbc_exec($conn,$sql);  if (!$rs) {exit("Error in SQL");} echo "<table><tr>"; echo "<th>First Name</th>"; echo "<th>Last Name</th></tr>"; while (odbc_fetch_row($rs)) {  $fname=odbc_result($rs,"fname");  $lname=odbc_result($rs,"lname"); echo "<tr><td>$fname</td>"; echo "<td>$lname</td></tr>"; }  odbc_close($conn); echo "</table>";  ?>

I am getting odd query results. I should be getting a list of students, over 100, but I am only getting 3. Here is my connection and sql, please help. It works excellent on PC, but the client is using a Mac. Please advise. On PC, I get all 100 rows, but on the Mac the client gets only 3 rows. With the exact same code.

<?php  $conn=odbc_connect('sitepoint','sitepoint','sitepoint'); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT fname, lname FROM table1"; $rs=odbc_exec($conn,$sql);  if (!$rs) {exit("Error in SQL");} echo "<table><tr>"; echo "<th>First Name</th>"; echo "<th>Last Name</th></tr>"; while (odbc_fetch_row($rs)) {  $fname=odbc_result($rs,"fname");  $lname=odbc_result($rs,"lname"); echo "<tr><td>$fname</td>"; echo "<td>$lname</td></tr>"; }  odbc_close($conn); echo "</table>";  ?>

Are you connecting to the same database?

That is a very odd problem. Do you always get just 3 results?

This article has been dead for over six months. Start a new discussion instead.