Gossamer Forum
Home : Products : Gossamer Links : Discussions :

MySQLMan Question/Problem

Quote Reply
MySQLMan Question/Problem
Hi:

I had no problems with SQL queries in the old Links, but seem to be banging my head on the new SQL Monitor.

Background: Prviously, when I had a contributor... lets say Ken Layton.... I would credit himn with a "Contributed By" credit which I put in the feild "Production_Notes" Because we now have "Linkowner" I was going to switch this "credit" over to this field, and print it on a detailed page with an <%if Linkowner%> statement. Easy!

OK, so I am in SQL Monitor, trying to run this commant to find all the cartoons Ken gave me:

In Reply To:
select * from Links WHERE Production_Notes LIKE '*Ken Layton*'
and I get no results. I have tried "%" in stead of "*", "Like" instead of "=", nothing. Yet, when I search from the Admin Interface, I DO get results of a Ken Layton search!

I am stymied... I am pretty sure my stntax is correct, why do I not get results?

dave

Quote Reply
Re: MySQLMan Question/Problem In reply to
Well,

The correct format would be:

select * from Links WHERE Production_Notes LIKE '%Ken Layton%'

But, I've hit a few "bugs" ? in MySQL where I had to use:

select * from Links WHERE Production_Notes LIKE ('%Ken Layton%')

Don't know why, but adding the () made all the difference in getting
complex AND searches to work, even though it was only around the search
term itself.

While it shouldn't make any difference, according to the docs, you
might want to try using double quotes instead of single quotes.


PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: MySQLMan Question/Problem In reply to
Pugdog:

Thank you VERY MUCH!!!!

dave

Quote Reply
Re: MySQLMan Question/Problem In reply to
Pugdog:

The parenthesis worked like a charm! I was also able to use this to Update Linkowner = 'Ken Layton' where Production_Notes LIKE ('%Ken%')- this worked fine with this addition!

Now, I have one more bit of "housekeeping!" I need to remove Ken's name from all the Production_Notes fields... How can I run the Select command and have it send to a text file, or all the results to ONE screen? (Currently, MySQLMan puts ten results per screen, in a table- I would like to see a straight text dump. Then could cut and past the dump into excel, Search and replace, delete and import the "corrected" data...)

dave

Quote Reply
Re: MySQLMan Question/Problem In reply to
Hi pugdog,

Was this in Mysql itself or just from within MySQLMan? I've never seen this..

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: MySQLMan Question/Problem In reply to
Hi,

Currently you can't although I've added it to the MySQLMan todo list. What you need to do is Export Data using MySQLMan, make your changes, and then use Import Data to put it back in.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: MySQLMan Question/Problem In reply to
Alex:

Dang! 10 megs is a LOT to download!

thanks!

d

Quote Reply
Re: MySQLMan Question/Problem In reply to
Well... I _know_ it was within MySQLman 1.3 and 1.4

It was in the SQL Monitor of 2.0b2 and 1.13

It was in the execution of an SQL query in 1.13

I noticed it because queries executed by scripts were returning the wrong values. I then used the SQL Monitor and MySQLman to test out queries, until I figured out the () made a difference.

Because of the reproduceability of this I'm assuming it's part of MySQL itself.

I'm using version 3.22.32



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: MySQLMan Question/Problem In reply to
Hi,

Do you have access to mysql from telnet shell? If so, can you just try it from their to see if it's a dbi issue or really a mysql issue.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: MySQLMan Question/Problem In reply to
I'll try. I'll have to figure out how to issue the interactive commands <G> I've been using a shell - either php or perl based since day one to insulate me from the command interpreter shell <G>

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: MySQLMan Question/Problem In reply to
Should be:

mysql -uUSERNAME -pPASSWORD DATABASE

or if it's not in path, try:

/usr/local/mysql/bin/mysql -uUSERNAME -pPASSWORD DATABASE

at which point you can type your SQL query in, ended with a semi-colen.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: MySQLMan Question/Problem In reply to
Ok,

It didn't make a difference in MySQL itself.

I guess that puts it in DBD:DBI somewhere.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ