How can I evaluate the capacity of Amazon EC2 Amis for my different templates;
A) Webserver (Apache/PHP) - pages/sec.
B) Database (MySql) - connections/sec.
C) App Server (Tomcat) - pages/sec.
I was hoping there was some kind of baseline tool that I can use to evaluate the many choices available on EC2 without using my System Under Deve...
How can I edit the latest row in the database. I only know it's the last one. I don't know its id.
...
Hello,
I have the following tables;
CREATE TABLE IF NOT EXISTS `tags` (
`tag_id` int(11) NOT NULL auto_increment,
`tag_text` varchar(255) NOT NULL,
PRIMARY KEY (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
CREATE TABLE IF NOT EXISTS `users` (
`user_id` int(11) NOT NULL auto_increment,
`user_display_...
I know this is a very basic question, thats why I just want a simple answer please, there is several ways to my user input safe for mysql.
Is using this the BEST method
mysql_real_escape_string()
On all user submitted items going into a mysql query?
If I use the above, do I need to use another function on that date when I get it bac...
In the past few years I have read plenty of articles on Foreign Keys in MySQL, nothing recent though. I know they are good to use on something like a forum topic that has child post's under it, if I delete a topic with 100 post's connected to that topic, foreign keys will make it delete those 100 topics for me, am I correct so far?
I...
First, I know that the sql statement to update table_a using values from table_b is in the form of:
Oracle:
UPDATE table_a
SET (col1, col2) = (SELECT cola, colb
FROM table_b
WHERE table_a.key = table_b.key)
WHERE EXISTS (SELECT *
FROM table_b
WHERE ta...
Hello,
I'm currently working on a game, and just a while ago i started getting start on loading and saving.
I've been thinking, but i really can't decide, since I'm not sure which would be more efficient.
My first option:
When a user registers, only the one record is inserted (into 'characters' table). When the user tries to login, a...
How do I format the string result of DateTime.Now in C# for insertion into a MySQL database table column of type DATETIME?
I have tried the following without any success:
insert blah
(Id, Content, DateCreated)
select 123, 'Blah blah blah', 1/5/2010 9:04:58 PM
insert blah
(Id, Content, DateCreated)
select 123, 'Blah blah bl...
In many reviews, there's usually a feature to sort by date, helpfulness, etc... Essentially these work by querying a new MySQL line right?
For example:
$sql = "SELECT * FROM TABLE ORDER BY TimeAdded"
$sql = "SELECT * FROM TABLE ORDER BY Helpfulness"
Or would there be a better way to do it?
Secondly, making pages for reviews. Is it a...
I have a table with just a single field named "tag", which is a varchar(250)
the field is defined with collation 'latin1_spanish_ci', because I'm planning to save words in spanish...
the problem is that the following query
select * from test where tag = 'unó'
gives me exactly the same result as
select * from test where tag = 'uno'
...
I got the following error from a MySQL query.
#126 - Incorrect key file for table
I have not even declared a key for this table, but I do have indices. Does anyone know what could be the problem?
...
Hello;
I want to insert about 50,000 mysql query for 'insert' in mysql db,
for this i have 2 options,
1- Directly import the (.sql) file:
Following error is occur
" You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit. "
2- Use php code to insert these queries in form of differ...
In MySql, I want to locate records where the string value in one of the columns begins with (or is the same as) a query string. The column is indexed with the appropriate collation order. There is no full-text search index on the column though.
A good solution will:
Use the index on the column. Solutions that need to iterate over all ...
Can I use mySQL in my commercial windows project? Are there any license issues? Which version should I use?
...
I've never had to use mysqli until today and cannot seem to get this right. What I want is a simple function that will accept a mysql procedure call and have it return those results.
When I started using these procedures, I noticed that the old way of querying the database, using mysql_query, would no longer get me the expected results;...
I need to do a Fulltext search for a whole bunch of values out of a column in another table. Since MATCH() requires a value in the AGAINST() part, a straightforward: "SELECT a.id FROM a,b WHERE MATCH(b.content) AGAINST(a.name)" fails with "Incorrect arguments to AGAINST".
Now, I know I could write a script to query for a list of names ...
I have to JOIN to large tables in a MySQL query and it takes really long - approximately 180 seconds. Are there any tips for optimizing a merge?
My table has 10 fields. I am only using 4 in the query - all strings. Table has about 600,000 rows and the result should have about 50 rows.
The four used rows are: Title, Variables, Locati...
Given: MySQL database. Sometimes db schema changes and updates are rolled out (in the form of sql script). In order to guarantee correct order of updates applied (no duplicate updates, no updates missing, etc) I plan to deploy the following solution:
CREATE TABLE meta (name TEXT PRIMARY KEY, val TEXT);
INSERT INTO meta VALUES ('version...
I know that when doing a INSERT IGNORE duplicate entries are ignored and errors become warning but here is what I need.
Scenario: We have a table with 2 columns (id, name) where BOTH are UNIQUE and id is PRIMARY KEY.
When you do an INSERT IGNORE on column name it creates the next AUTO_INCREMENT for id (even though it later doesnt exist...
Consider a web app in which a call to the app consists of php script running several MySQL queries, some of them memcached.
The PHP does not do very complex job. it is mainly serving the mysql data with some formatting.
In the past it used to be recommended to put mysql and the app engine (PHP/Apache) on seperate boxes.
However, whe...