Edson David
2014-04-01 12:07:35 UTC
Guys, I'm trying to make the connection to the SQL Server database using adodb, but when I run the lines below, the page is blank, not returning any rows. The problem from what I dectetei, is when the connection attempt is made ââwith the server and the table data.Â
Thank you in advance.
<?php
// Include the library
include('adodb/adodb.inc.php');
$conn = &ADONewConnection('mssql');
$conn->Connect('192.168.1.2:1433','','','siscom'); // Connection to the database
$sql = "SELECT * FROM agenda"; // Select the table columns calendar
$consulta = $conn->Execute($sql);
// Displaying Data
echo("<table width='250' border='1'>
    <tr>
      <td>ID</td>
      <td>Name</td>
    </tr>");
while(!$query->EOF) {
  echo("<tr>
      <td>" . $query->fields[0] . "</td>
      <td>" . $query->fields[1] . "</td>
     </tr>");
  $query->MoveNext();Â
}
// Number of table recordsÂ
$tot_register = $consulta->RecordCount();
echo("<tr><td colspan='2'> Total record (s): " . $tot_register . "</td></tr>");
echo("</table>");
Thank you in advance.
<?php
// Include the library
include('adodb/adodb.inc.php');
$conn = &ADONewConnection('mssql');
$conn->Connect('192.168.1.2:1433','','','siscom'); // Connection to the database
$sql = "SELECT * FROM agenda"; // Select the table columns calendar
$consulta = $conn->Execute($sql);
// Displaying Data
echo("<table width='250' border='1'>
    <tr>
      <td>ID</td>
      <td>Name</td>
    </tr>");
while(!$query->EOF) {
  echo("<tr>
      <td>" . $query->fields[0] . "</td>
      <td>" . $query->fields[1] . "</td>
     </tr>");
  $query->MoveNext();Â
}
// Number of table recordsÂ
$tot_register = $consulta->RecordCount();
echo("<tr><td colspan='2'> Total record (s): " . $tot_register . "</td></tr>");
echo("</table>");