0

When trying to return all results from my table using odbc_result_all i find that it will print all the results except the last one. I'm not sure why its doing this or if an Access database takes a while for the results to be updated when queried?

Can anyone help?

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by stonest123
0
<?php
$conn=odbc_connect('backuplogs','','');

if (!$conn)

{exit("Connection Failed: " . $conn);}

$postlocation = $_POST['t1'];
$postresponsible = $_POST['t2'];


$results="SELECT * FROM BackupLog WHERE 
Location = '$postlocation' 
AND Responsible = '$postresponsible'";

$lastresult="SELECT MAX(Location) FROM BackupLog WHERE Location = '$postlocation'";

$rs=odbc_exec($conn, $results);
$last=odbc_exec($conn, $lastresult);

while (odbc_fetch_array($rs)){


$servername=odbc_result($rs, "Servername");

$results2 = odbc_result_all($rs, "border=1");

echo $results2;

echo "</table>";	

}

while (odbc_fetch_row($last)){

$lastone=odbc_result($rs, "19_10_2010");

echo $lastone;
}


odbc_close($conn);
?>
0

the last part of it is me trying to echo out the last row of the database, just ignore that bit.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.