[PHP-DB] mssql_query returns a boolean false instead an empty recordset when the query doesn't match any record

2005-11-07 Thread Pablo F. Díaz Anzalone
Hi all, I'm moving my intranet pages from one server to a new one. In the first server everything works ok but in the new one we are having problems because every time that we are expecting a recordset and it should be empty because the query doesn't match any record it is return a boolean

[PHP-DB] transactions

2005-11-07 Thread martin lutsch
hi, i have a problem with mysql transactions and php: i want to do a transaction through more than one php scripts. i think, if one script ends and links to another, the database connection ends and the transaction rolles back. how can i continue one transaction through more than one script? any

Re: [PHP-DB] mssql_query returns a boolean false instead an empty recordset whenthe query doesn't match any record

2005-11-07 Thread Ziv Gabel
you can try this while ($row = @mssql_fetch_array($result, MSSQL_ASSOC)) { if(!$row) { continue; } else { //process each registry from the query } } Best Regards Ziv Gabel Pineapp Support - Original Message

[PHP-DB] Specific order by MySQL statement

2005-11-07 Thread Adrian Bruce
Hi I am trying to get results from a MySQL query in a specific order, just using ASC or DESC will not work. For Example I have a field that can contain 4 possible values: 'Current', 'Completed','Withdrawn' or 'Transferred', I would like to order the results specifically like: Current

Re: [PHP-DB] Specific order by MySQL statement

2005-11-07 Thread Constantin Brinzoi
One possibility is to use codes for this filed, such as: 10 for Current; 20 for Completed; 30 for Withdrawn; 40 for Transferred. a.s.o. If you will discover other states of the field you can insert them apropriatelly (if you want Canceled state to be inserted and to be displayed last put the

Re: [PHP-DB] mssql_query returns a boolean false instead an empty recordset whenthe query doesn't match any record

2005-11-07 Thread Bastien Koert
He needs to check whether the query worked before he attempts to access the data $result = mssql_query($query); if (mssql_errno) != 0) { echo error in query :. mssql_error(); die(); } Bastien From: Ziv Gabel [EMAIL PROTECTED] To: Pablo F. Díaz Anzalone [EMAIL

RE: [PHP-DB] transactions

2005-11-07 Thread Bastien Koert
I don't think you can. Once the script finishes the connections are closed and the transactions completed. What are you trying to do where you need to have the transaction across multiple pages? Perhaps, if you are gathering the data across the pages, you could use a session to store the data