Re: Result problem

From: Date: Wed, 25 Apr 2007 21:12:50 +0000
Subject: Re: Result problem
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-253762@lists.php.net to get a copy of this message
2007. 04. 25, szerda keltezéssel 17.03-kor Dan Shirah ezt írta: > Okay, print_r($result_record) for the query result. $result_record is a resource identifier. you are not interested in that too, I think... ;) if you want all records, then stuff them into an array and use that: while ($row_record = mssql_fetch_array($result_record)) { $id_record[] = $row_record['id']; } print_r ($id_record); greets Zoltán Németh > > But I still don't know why it's only returning the last record of the > query instead of all the results. > > On 4/25/07, Zoltán Németh <znemeth@alterationx.hu> wrote: > 2007. 04. 25, szerda keltezéssel 16.56-kor Dan Shirah ezt > írta: > > Any ideas why my query only returns the very last record > that matches the > > criteria specified?? > > > > $sql_record ="SELECT * FROM payment_request WHERE > status_code = 'P'"; > > $result_record = mssql_query($sql_record) or > die(mssql_error()); > > if(!empty($result_record)) { > > while ($row_record = mssql_fetch_array($result_record)) { > > $id_record = $row_record['id']; > > } > > } > > print_r ($sql_record); > > in the above line you are printing out the query. I think > that's not > what you want... > > greets > Zoltán Németh > > > > > The result of the print_r displays only the last record that > matches the > > query criteria. I tried a foreach instead of a while with > no luck. > >

« previous php.general (#253762) next »