Bug #8011 Pasting PHP queries.
Submitted: 19 Jan 2005 16:52 Modified: 5 Mar 2009 12:23
Reporter: Stuart Colville Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Query Browser Severity:S4 (Feature request)
Version:1.1.5 OS:Windows (Win2K)
Assigned to: CPU Architecture:Any

[19 Jan 2005 16:52] Stuart Colville
Description:
These small things are not really important just be great if they could work even better.

When pasting from php a query such as:

$SQL = "SELECT Id, Name, Country FROM City";
$SQL .= "WHERE id = 1";

the browser shows:

SELECT Id, Name, Country FROM City
:SQLWHERE id = 1

Perhaps where a variable matches the first variable it could be stripped so this will work. 

Also it would be really nice if when you paste something like:

$SQL = "SELECT Id, Name, Country FROM City WHERE id = '$value' ";

When executing the query you are promted to enter a value for $value in a pop-up field entry box before the query executes. 

How to repeat:
As above

Suggested fix:
As above
[19 Jan 2005 19:16] MySQL Verification Team
This should be a feature request.
[19 Jan 2005 21:14] Michael G. Zinner
Just a question. Why do you use

$SQL = "SELECT Id, Name, Country FROM City";
$SQL .= "WHERE id = 1";

instead of 

$SQL = "SELECT Id, Name, Country FROM City" .
       "WHERE id = 1";

or 

$SQL = "SELECT Id, Name, Country FROM City
        WHERE id = 1";

The later ones should work as expected. But you might have your reason for your version.
[19 Jan 2005 22:39] Stuart Colville
This is just an example, normally this way of extending onto a new line is used for larger queries only.
[23 Jan 2005 14:51] Alexandru Mihai Bîrsan
I have tested this feature of MySQL QB and I found some quirks. Copying works pretty well. Pasting back into IDE doesn't work at all as expected. Here's some feedback data. All tests were made with QB 1.1.5 and EditPlus 2

#1 - copy: ok
$SQL  = "SELECT Id, Name, Country FROM City" .
            "WHERE Id = 1";
#1 - paste: wrong - note last two lines repeated 15 times (number varies)
    $SQL  = "SELECT Id, Name, Country FROM City" .
           "WHERE Id = 2" +
	   "SELECT Id, Name, Country FROM City " +
	   "WHERE Id = 2" +

#2 - copy: shouldn't really catch second line
$SQL  = "SELECT Id, Name, Country FROM City";
            "WHERE Id = 1";
#2 - paste: same problem

#3 - copy: as this bug submission originally stated, this should work; it's valid PHP :D
$SQL  = "SELECT Id, Name, Country FROM City";
$SQL .= "WHERE Id = 1";

How to repeat:
Just copy and paste like it says in the "Help".
[20 Feb 2005 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[20 Feb 2005 17:16] Aleksey Kishkin
Sorry, this bug was wrongly closed as 'no feedback' despite the fact that user provided feedback . Reopened.
[29 Sep 2007 12:57] Valeriy Kravchuk
This:

"Also it would be really nice if when you paste something like:

$SQL = "SELECT Id, Name, Country FROM City WHERE id = '$value' ";

When executing the query you are promted to enter a value for $value in a pop-up field entry box before the query executes."

is surely a reasonable feature request.
[5 Mar 2009 12:23] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Query Browser into MySQL Workbench. We won't add this feature request anymore.

More informations about MySQL Workbench you will find here:

http://dev.mysql.com/workbench/