NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
how to execute SQL in db browser?


Joined: 23 Nov 2007
Posts: 11
Reply with quote
Hi,

I am using the DB Browser Client in PHPED. I have setup the connection to the database and things seem to be fine ie, if I double click on the tables I can see their content etc. The problem I am having is the under the tab SQL when I enter a mysql command and hit the "Flash" button (Execute script) - nothing happens.
Is there a window suppose to open or something that will give me the result of the command execution? I am obviously missing something.

Please advise.

Thanks,
Olimpiu
View user's profileFind all posts by odejeuSend private message


Joined: 24 Oct 2006
Posts: 98
Location: Melbourne, AU
Reply with quote
The result of the query will usually appear below the editing area if the query is successful.

Have you tried a simple "select * from tablename"?
View user's profileFind all posts by LatsSend private message


Joined: 23 Nov 2007
Posts: 11
Reply with quote
Hi,

yes, that is pretty much what I am trying, just simple commands. There is an area under the command area but it is blank at all times.
I would expect at least some error message to pop up but ... nothing.

Thanks.
View user's profileFind all posts by odejeuSend private message


Joined: 24 Oct 2006
Posts: 98
Location: Melbourne, AU
Reply with quote
I can't even see where to close that output pane.

Try View -> Restre Default Layout

Perhaps you've minimized it somehow?
View user's profileFind all posts by LatsSend private message


Joined: 23 Nov 2007
Posts: 11
Reply with quote
I've figured it out but I think this is a problem in PhpED or a ... feature.

If I type a command with a semicolon at the end then nothign gets displayd, for example:

select * from foo;

but if I do the same without the semicolon then all seems to be working fine and I get the expected result

so:

select * from foo

works

Now, the problem is that the only way there can be multiple lines is if one uses the semicolon but then again, only the last line (the one that does not end in a semicolon) executes.

Unless I am missing a setting somewhere, if the tool allows one to enter mysql commands then it should go by mysql syntax and be able to handle semicolons (after all it PhPED wants them if you have multiple lines).

I am almost regretting that I have spend $199 for a license
View user's profileFind all posts by odejeuSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
you may have multiple sql statements delimited with semicolon. In this case result-set is not what people would expect Smile

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 23 Nov 2007
Posts: 11
Reply with quote
dmitri,

I am not sure I understand your reply. Could you please elaborate. Thanks
View user's profileFind all posts by odejeuSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
if you have multiple insert statements, you can run them at once:
insert blahblahblah;
insert blahblahblah;

but if they are select statements, I don't think you want to run multiple at once. Therefore no need to use semicolon

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 23 Nov 2007
Posts: 11
Reply with quote
Hi Dmitri,
I see what you mean and you are right about what one wants to run at once and what not.

Here are my thoughts on this issue:

My initial problem came from the fact that I was not seeing any output in the PhpED window - just because I was adding semicolon at the end of the "select" line. In reading your reply I think the basic issue is - inconsistency.

I think to correctly solve this is:

1. if the tool (ie PhpED) allows the user to enter MySql (or any other sql database) it should go by the command line syntax of that db. (the mysql statement delimiter is a semicolon)
OR
2. don't allow this at all ie, the PhPED interface into a sql database

While I would think that nr. 2 is not acceptable I would hope that nr. 1 will eventually be implemented.

Just as a side note, using PhPED more and more I am pretty impressed with its capabilities Very Happy

Best regards,
Olimpiu
View user's profileFind all posts by odejeuSend private message


Joined: 29 Aug 2007
Posts: 39
Reply with quote
I have come across this too ... I was trying to get SQLite access working and I couldn't figure out why selects weren't returning results.

Dmitri, why not just trim ; from the end of the query string (not line) to prevent just this issue?
View user's profileFind all posts by StryksSend private message
how to execute SQL in db browser?
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