Is there a simple way to cache MySQL queries in PHP or failing that, is there a small class set that someone has written and made available that will do it? I can cache a whole page but that won't work as some data changes but some does not, I want to cache the part that does not.
...
I have a MySQL table with coordinates, the column names are X and Y. Now I want to swap the column values in this table, so that X becomes Y and Y becomes X. The most apparent solution would be renaming the columns, but I don't want to make structure changes since I don't necessarily have permissions to do that.
Is this possible to do w...
i have three tables tag, page, pagetag
With the next data
page
ID NAME
1 page 1
2 page 2
3 page 3
4 page 4
tag
ID NAME
1 tag 1
2 tag 2
3 tag 3
4 tag 4
pagetag
ID PAGEID TAGID
1 2 1
2 2 3
3 3 4
4 1 1
5 1 2
6 1 3
I would like to get a str...
At the moment my code (PHP) has too many SQL queries in it. eg...
// not a real example, but you get the idea...
$results = $db->GetResults("SELECT * FROM sometable WHERE iUser=$userid");
if ($results) {
// Do something
}
I am looking into using stored procedures to reduce this and make things a little more robust, but I have some...
I'm building a basic search functionality, using LIKE (I'd be using fulltext but can't at the moment) and I'm wondering if MySQL can, on searching for a keyword (e.g. WHERE field LIKE '%word%') return 20 words either side of the keyword, as well?
...
Does there exist any asynchronous connectors to Mysql that can be used in C or C++? I'm looking for something that can be plugged into a reactor pattern written in Boost.Asio.
[Edit:] Running a synchronous connector in threads is not an option.
...
If I've got a table containing Field1 and Field2 can I generate a new field in the select statement? For example, a normal query would be:
SELECT Field1, Field2 FROM Table
And I want to also create Field3 and have that returned in the resultset... something along the lines of this would be ideal:
SELECT Field1, Field2, Field3 = 'Valu...
i am having serious performance problems (queries up to 55 seconds) while running a mysql query since i added a group_concat clause.
my query looks like:
select ... group_concat(distinct category.name) .... from page where
left outer join page_category on page.id = page_category.page_id
left outer join category on page_category.cat...
I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I would like to either run a script and/or have a cron job running. What are some good ways of doing this?
Some points ...
I have a table which is full of arbitrarily formatted phone numbers, like this
027 123 5644
021 393-5593
(07) 123 456
042123456
I need to search for a phone number in a similarly arbitrary format ( e.g. 07123456 should find the entry (07) 123 456
The way I'd do this in a normal programming language is to strip all the non-digit chara...
I've recently been tasked with developing a web application that will use a MySQL database on the back end. I for most of my career I have worked with MS-SQL Manager. My greatest weakness is in defining foreign key constraints I usually use MS-SQL Manager's diagramming tool to draw my relationship lines between tables.
...
Here is the deal.
$ gem --version
1.1.0
$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Bulk updating Gem source index for:
http://gems.rubyforge.org/ ERROR:
could not find mysql locally or in a
repository
$ sudo gem update
Updating installed gems Bulk updating
Gem source index...
I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load.
How could I go about doing this?
...
I have a table in an access table which contains Product entries, one of the columns has a jpg image stored as an OLE Object. I am trying to import this table to MySQL but nothing seems to work. I have tried the MySQL migration tool but that has a known issue with Access and OLE Objects. (The issue being it doesnt work and leaves the...
I am using the ODBC connector to access a MySQL db from visual studio 2008 and i am facing performance problems when dealing with crystal reports and to solve this i need a native connector to visual studio. if someone has had a similar problem and knows a solution or tools ( freeware preferable ) , i would be really grateful.
...
I'm looking to use SQL to format a number with commas in the thousands, but no decimal (so can't use Money) - any suggestions?
I'm using SQL Server 2005, but feel free to answer for others as well (like MySQL)
...
There are numerous libraries providing Linq capabilities to C# code interacting with a MySql database. Which one of them is the most stable and usable on Mono?
Background (mostly irrelevant): I have a simple C# (.Net 2.0) program updating values in a MySql database. It is executed nightly via a cron job and runs on a Pentium 3 450Mhz, L...
For example, I issued an ALTER TABLE statement to create an index on a MEDIUMTEXT field in an InnoDB table that has 134k rows where the size of the index was 255 bytes and the average size of the data in the field is 30k. This command has been running for the last 15 minutes or so (and is the only thing running on the database). Is the...
I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?
...
Let's say that I want to have a table that logs the date and the number of columns in some other table (or really any sort of math / string concat etc).
CREATE TABLE `log` (
`id` INTEGER NOT NULL AUTO_INCREMENT ,
`date` DATETIME NOT NULL ,
`count` INTEGER NOT NULL ,
PRIMARY KEY (`id`)
);
Is it possible to have the count column calcula...