order by clause
| From: | luc raymond | Date: | Thu, 24 May 2001 12:14:09 +0000 |
| Subject: | order by clause | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-9607@lists.php.net to get a copy of this message | ||
I have the following warning message on the client web page when I use an
order by in my query. If I remove it, the message dissapear.
----------------------------------------------------------------------------
--------------------------------------------------------
Warning: SQL error: [Microsoft][ODBC SQL Server Driver]Cursor type
changed, SQL state 01S02 in SQLExecute in
D:\Inetpub\wwwroot\info\listedeprix.php on line 9
----------------------------------------------------------------------------
--------------------------------------------------------
Any idea why?
I have the following code
----------------------------------------------------------------------------
--------------------------------------------------------
odbc_close_all();
$sql=odbc_connect("informatique","userinfo","userinfopswd");
$statement = odbc_prepare($sql, "select piece_desc,piece_prix*1.16 as
'prix' , c.categorie_desc from pieces p join categories c on p.categorie_id
= c.categorie_id order by c.categorie_desc ");
$result=odbc_execute($statement);
if ($result!=0)
{
while(1)
{
$prix=odbc_result($statement, "prix");
$desc=odbc_result($statement, "piece_desc");
$categorie=odbc_result($statement, "categorie_desc");
echo("$categorie :: $desc ($prix)<br>");
if (odbc_fetch_row($statement)==false)
break;
}
}
odbc_free_result($statement);
odbc_close_all();