I've done a mysqldump of a large database, ~300MB. It has made an error though, it has not escaped any quotes contained in any <o:p>...</o:p> tags. Here's a sample:
...Text here\' escaped correctly, <o:p> But text in here isn't. </o:p> Out here all\'s well again...
Is it possible to write a script (preferably in Python, but I'll take ...
Hello,
I have a database of song titles. Each song title has an assigned integer score. The higher the score the higher it ranks on my website.
So if "Lady Gaga - Poker Face" has a score of 23039, and "Eminem - Not Afraid" has a score of 13400, Lady Gaga will be above Eminem.
This is of course accomplished by a simple ORDER BY score D...
When I save an apartment record in rails, for some reason it is updating the updated_on field and the created_on field. I can't figure out how/why the created_on field is being updated.
To try and debug the situation, I opened up a console window and did the following
t = Apartment.find(11619)
t.beds = 4
t.save
When I check my log fi...
I want to post something to my database which consists of two tables which are linked with a foreign key. I want to be able to post something to the first table which has only two cells (city and city_id) via php and then get redirected to the second table where someone can post detail about places of the city (houses squares ect (city_i...
If I run this query:
SELECT `Manga`.`id`, `Manga`.`name` FROM `mangas` AS `Manga` WHERE `Manga`.`id` in
(
SELECT `manga_id` FROM `mangas_genres` where `manga_id` = 1
)
My computer does not respond (I just mistype). It can't run this query.
Is the above code invalid? Please, help me.
I think it is valid, but it can't run. I don't und...
Is there a mysql query to find and replace parts of field names?
I know you can do that within the actual data using
update [table_name]
set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');
... but how do you do that for the actual field names?
I have some fields with a - in the name, and I'd like...
Hi, I have a mysql query as follows:
SELECT *, MATCH(songtitle) AGAINST('{keyword}') as Relevance FROM links WHERE approved = "true" AND MATCH(songtitle) AGAINST('{keyword}' IN BOOLEAN MODE) ORDER BY Relevance DESC, score DESC LIMIT 5
This works generally as expected, but for certain queries it will not return the right results. It wo...
I'm looking at installing atmail as a replacement to my home-grown system for internal member-to-member emails on my website.
Currently, these messages are kept in mysql.
All of the IMAP servers I've come across keep emails on the filesystem, I'm guessing there are allot of good reasons that there are not many implementations using mys...
I want to change the values of column this in table_one where this = 1 and id value of that row exists anywhere in table_two's column other_id
So I'm using this query:
UPDATE table_one SET this='0' WHERE this='1' AND table_one.id IN (SELECT other_id FROM table_two);
The query took several hours without yet finishing, so I was wonderi...
I have a table for pages with fields slug (string, not unique) and updated (datetime). I want to retrieve a list of last updated pages based on the updated field, but I only want one result for every slug (since slugs can be re-used across pages in this case). What to do?
I tried this:
SELECT * FROM `pages`
GROUP BY `slug`
ORDER BY `up...
i want to add a new column noOfTry in a table which already have some columns. the column data will be integer type and default value will be 0. i know i need to use alter query, just asking for the correct format of the query for this case
...
I followed this instruction but not worked for me. I just wanna install and config cakephp in my new MacBook Pro and that's why I'm tried to rename my php.ini.default to php.ini. Before that, I had no problem in communicating between my MySQL and Mac pre-installed PHP.
What's wrong with that instruction. ( specially "Getting MySQL and ...
I need both MyISAM tables and InnoDB tables in my database, I am using hbm2ddl to create them. Can I create both MyISAM and InnoDB tables in the same database using Hibenrate hbm2ddl?
It seems that selecting the dialect forces me to use one or the other.
...
I have a mysql table :
dateStarted varchar(45)
dateEnded varchar(45)
Example:
There are varchar (I dont know why Previous programmer used this).
Can I search between two dates in mysql with varchar type?
Thanks in advance
...
Hi,
I know this subject has been covered before on here but I need a different result to the other questions.
I need to order some results on institution name and then candidates last name.
SELECT DISTINCT candidates.*, histories.job_title, institutions.name
FROM candidates
JOIN histories ON histories.candidate_id = candidates.id
JOI...
my query:
SELECT events.*, SUM(analyt_event_hits.ajax_hits) AS ajax_hits
FROM events
LEFT JOIN analyt_event_hits
ON events.event_id = analyt_event_hits.event_id
WHERE events.date >= '$d'
the problem:
this is only returning one result,
when it should be returning many.
The query works fine if i remove SUM(anal_event_hits.ajax_...
Hi,
I have a table called 'business' with the following sample data:
Street - 150 N Michigan Ave.
City - Chicago
State - IL
Zip - 60601
When I run a query like
SELECT business.*
WHERE MATCH(business.Street, business.City, business.State, business.Zip)
AGAINST('*150*' IN BOOLEAN MODE)
-- IT WORKS
SELECT busines...
Hi,
Table:
cat_name / topic
cat1 topic1
cat3 topic1
cat6 topic2
cat4 topic3
cat3 topic3
cat3 topic4
SELECT * from all_cat
WHERE cat_name = "cat4" OR ...
The result should be:
cat4 topic3
cat3 topic4
How to select (in MySQL) all the topic'us form category 4, and even those that belong only to category ...
I have a form that is being filled by customers, the form is very long and contains approximately 30-40 fields.
One part of the form is particularly complex to store as it is a matrix of checkboxes that the user needs to select.
Example:
> Fir Item | A Checkbox | B Checkbox | C Checkbox
> Sec Item | A Checkbox | B Checkbox | C Checkbo...
I am trying to install mysql on snow leopard and having some problems.
I followed these steps in the hivelogic blog
http://hivelogic.com/articles/compiling-mysql-on-snow-leopard
all goes well but when i get to the final step i try to do
mysql -uroot
i get this
-bash: mysql: command not found
what am i doing wrong
...