views:

15

answers:

1

I am firing off a query in PHP to an MS Access database/odbc connection. The query looks like this

$commentSQL = "SELECT * FROM tblTicketComments WHERE requestNum = $foo";
$rs1 = odbc_exec($conn,$commentSQL);
if(!$rs1){
    $this->comments[] = odbc_errormsg();
}
while($rs1){
    $this->comments[] = "comment";
    }

$foo is a number, and requestNum is a number field. When I fire off the query the page just hangs at "rs1 = ...". No error message, it will output everything up to that line, but nothing after. If I change $commentSQL line to

$commentSQL = "SELECT * FROM tblTicketComments WHERE requestNum = '$foo'";

I will at least get a type mismatch error...

This is a brand new table with like 6 rows for testing so I can't imagine that the query is taking too long.

Can someone help me troubleshoot this, please?

+1  A: 

Change:

while($rs1){

To something like:

while(odbc_fetch_row($rs1)){

As the result resource will remain 'true', you effectively have a while(true){} loop at the moment.

Wrikken
Yeesh... thank you.
Chris Sobolewski