Hi,
We have 50 tables in our mysql database. Queries are taking time as many of the tables have more than 15K records.
I know adding indexes increases the query performance, my query is, on adding indexes on existing tables will have any harm to existing users?
Please share your thoughts.
Thanks.
...
I am working with an old MySQL table, which serves as a log of sorts. It looks like
CREATE TABLE `queries` (
`Email` char(32) NOT NULL DEFAULT '',
`Query` blob,
`NumRecords` int(5) unsigned DEFAULT NULL,
`Date` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Now, I need to be able to UPDATE the records in this table ...
Hi, i have a details table with columns:
user_id int
code int
value int
And i want to build a summary table that looks like:
user_id int
valueA int
valueB int
In the details table, valueA would correspond to say, code 5, and valueB would correspond to say, code 6, so i'm looking for something like:
insert into summary (user_id,v...
I've got a table in MySQL that looks roughly like:
value | count
-------------
Fred | 7
FRED | 1
Roger | 3
roger | 1
That is, it was created with string ops outside of MySQL, so the values are case- and trailing-whitespace-sensitive.
I want it to look like:
value | count
-------------
Fred | 8
Roger | 4
That is, managed by MySQ...
Hi,
I'm using MySQL to pull lat longs from a database and check whether or not they are in a particular neighborhood.
Everything works great, except if the point is on the border between two neighborhoods. Then, the point is included in both neighborhoods. It gets duplicated. What's the best way to handle points that are on borders?
...
I'm making a survey with PHP and MySQL. I'm having trouble figuring out what method to use to display a random set of 10 questions, and their answers. Each question can have between 2 and 5 answers.
Here is how the database is set up:
questions:
ID | quID | question
answers:
ID | an_quID | anID | answer
quID and an_quID link the tab...
My site allows users to submit After Action Reports and yesterday someone set the new record with a ~48,000 character beast of a report. While that's still only 74% of the TEXT maximum character count, it made me wonder what should be done when someone wants to submit something that exceeds the 65k limit...? It's bound to happen eventual...
Hi
I've been looking for a solution to this issue and have tried most answers found. But with no luck was I able to insert the Japanese xml feed into the tables which have been created.
I tried setting all setting where UTF8 should be used as most answers have suggested - But no luck!!
Can someone guide me through.
Thanks
Sam
...
I currently have a hard coded view with the following sql:
select username
,(case user_role.role_id when 1 then true else false end) as ROLE_SUPER
,(case user_role.role_id when 2 then true else false end) as ROLE_ADMIN
,(case user_role.role_id when 3 then true else false end) as ROLE_VIEW
,(case user_role.role_id whe...
When I try to instert a string that contains a quote mark, the INSERT query fails. How can I insert strings with single or double quotes?
for example:
$message = "Bob said 'don't forget to call me'";
mysql_query("INSERT INTO someTable (messages) VALUES ('$message')");
I figure the input needs to be filtered but which function should...
I found the count down script in http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm
It works fine if i just define the date but when I try to pass the date from this php/mysql query into the js file, it works only for the first record and not after that.
<script type="text/javascript" src ="time.js"></script>//this is the script ...
This is my setup:
Table "files": id (PK), filename, user_id, date, filesize
Table "scores": id(PK), file_id, user_id, score
Table "files" contains a list of files with details; table "scores" keeps track of 1-5 points scored per file. I need to get entries from the "files" table and in each row I need all the info for the file, as we...
Hello,
I am comparing two lists of email addresses in mysql - listA and listB (both of which are views). Originally, I wanted to find all of the email addresses in listA that are not in listB. I successfully accomplished that with:
$comparison_query = mysql_query("SELECT DISTINCT email_addresses FROM listA WHERE email_addresses NOT IN ...
Does anyone know how to display MySQL db hierarchical data (Nested Set Model (http://www.phpro.org/tutorials/Managing-Hierarchical-Data-with-PHP-and-MySQL.html)) in a combo box as shown here under the "Category:" comboxbox field:http://dir.globetourism.biz/submit.php
Thanks
...
I want to set some timeout for a mysql query to execute in java.
...
Around the time of a release I saw in Munin that the number of queries increased dramatically, on a regular frequency. These aren't slow queries. Rather than doing the brute force method of going over my code to see what is causing the excessive number of queries, I'd like to know if there's an open source solution that can monitor a run...
Sure, I can write a function for it in Python or something...but how can I do it in MYSQL?
WHERE title = "heart of darkness" more or less 3 characters...
...
Hi,
I have a query like below to select 'sid' with highest count and its 'lid'. Now I'd like to select details of 'lid' from another table and keep the 'tot' in the result set. Is that possible?
select count(distinct sid) as tot, lid
from wt_stats_linkclicks
where statsid IN (1)
GROUP BY lid order by tot DESC limit 1
Thanks!
...
My goal is to return a start and end date having same value in a column. Here is my table. The (*) have been marked to give you the idea of how I want to get "EndDate" for every similar sequence value of A & B columns
ID | DayDate | A | B
-----------------------------------------------
1 | 2010/07/1 | 200 | 300
2 | 2010/07/2 | 2...
Hi Everyone,
I have a program in php that should display the random images without repetition,I was able to store the images in the database, but I don't have any idea to do this can anyone help me with this.
Thank you,
...