Please bear with me as i am trying PHP for the first time
i have the following code and it gives me no errors but no records - am i missing something?
<?php
// Connects to your Database
$dsn="DBNAME";
$username="sa";
$password="xxxxxxx";
$sqlsrv_connect=odbc_connect($dsn, $username, $password);
$strSQL = "SELECT * FROM TBL_INSTRUCTIONS ORDER BY DATEADDED DESC";
// Execute the query (the recordset $rs contains the result)
$rs = sqlsrv_query($strSQL);
// Loop the recordset $rs
while($row = sqlsrv_fetch_array($rs)) {
?>
<tr>
<td class="with-checkbox">
<input type="checkbox" name="check" value="1">
</td>
<td><?php echo $row['FIRSTNAME']?></td>
<td><?php echo $row['SURNAME']?></td>
</tr>
<?php
}
// Close the database connection
mysql_close();
?>
i have the following code and it gives me no errors but no records - am i missing something?
<?php
// Connects to your Database
$dsn="DBNAME";
$username="sa";
$password="xxxxxxx";
$sqlsrv_connect=odbc_connect($dsn, $username, $password);
$strSQL = "SELECT * FROM TBL_INSTRUCTIONS ORDER BY DATEADDED DESC";
// Execute the query (the recordset $rs contains the result)
$rs = sqlsrv_query($strSQL);
// Loop the recordset $rs
while($row = sqlsrv_fetch_array($rs)) {
?>
<tr>
<td class="with-checkbox">
<input type="checkbox" name="check" value="1">
</td>
<td><?php echo $row['FIRSTNAME']?></td>
<td><?php echo $row['SURNAME']?></td>
</tr>
<?php
}
// Close the database connection
mysql_close();
?>