NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
SQL command SELECT


Joined: 27 Sep 2011
Posts: 10
Reply with quote
The SQL command SELECT does not work with ;

Why?

thank !!
View user's profileFind all posts by gladiiiSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
In what context are you trying to use the SQL SELECT command with ; ?

Somewhere in PhpED? In your PHP code? Please tell us more Smile
View user's profileFind all posts by plugnplaySend private message


Joined: 27 Sep 2011
Posts: 10
Reply with quote
in PhpED the SQL SELECT command works without ;
ONLY Shocked
View user's profileFind all posts by gladiiiSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
So you are using the DB Browser SQL panel?

As far as I am aware, that panel will execute all SQL statements including multiple statements that separated by ;

However, PhpED only displays the result of the last SQL statement. If the last SQL statement ends with a ; then it appears that PhpED counts that as an empty result set and displays nothing, which might well be construed as a bug although Nusphere might also argue that it is a deliberate feature to allow you to stop a result set being displayed.

For example, this update and select works and displays a result set:

Code:
update table1 set name="test" where name="testX"; select * from table1 where name="test"


This also works fine, but the last ; means PhpED displays an empty result set:

Code:
update table1 set name="test" where name="testX"; select * from table1 where name="test";


I guess it's also possible that MySQL is responsible for returning the empty result set. I haven't tested that.
View user's profileFind all posts by plugnplaySend private message


Joined: 27 Sep 2011
Posts: 10
Reply with quote
Yes I use the DB Browser SQL panel Very Happy

It really makes no sense and I think this is a bug

thank you anyway
View user's profileFind all posts by gladiiiSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
If it causes problems for you, I recommend you report it at http://shop.nusphere.com/customer/support.php

Looks like a straight-forward bug for them to fix.
View user's profileFind all posts by plugnplaySend private message


Joined: 27 Sep 2011
Posts: 10
Reply with quote
even if PhpED only displays the result of the last SQL statement you can put a ;
in the logic ...

thank you
View user's profileFind all posts by gladiiiSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
semicolon separates different statements. It makes sense to run multiple insert/update/delete etc in one script. In this case phped runs in batch mode and no data is fetched -> so selects does not show the data.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
SQL command SELECT
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic