php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19015 IF Statement fails in mssql_query()
Submitted: 2002-08-21 07:11 UTC Modified: 2002-08-23 02:54 UTC
From: joe dot binnington at xko dot co dot uk Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.2.2 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joe dot binnington at xko dot co dot uk
New email:
PHP Version: OS:

 

 [2002-08-21 07:11 UTC] joe dot binnington at xko dot co dot uk
This query works:
 
      select * from tablename

...but this query doesn't:
 
      if (1=1) select * from tablename

Apparently, in the second query, two results are returned, the first is empty, the second is the correct result set.  I know that I could put the IF statement directly into PHP but there are good reasons why we need them to work within the SQL statement.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-21 07:15 UTC] jan@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.
 [2002-08-21 07:20 UTC] joe dot binnington at xko dot co dot uk
This is not a support question.  The second query should work but doesn't.  It is not because the SQL is incorrect, it is because the mssql_query() function in php_mssql.dll does not process the second query correctly.
 [2002-08-23 02:54 UTC] georg@php.net
If the second query doesn't work, it's a mssql problem. 
The PHP extension just sends the query via dbcmd call to the server, which executes the query.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Jun 05 00:03:38 2023 UTC