mysql

Can you recommend a free light-weight MySQL GUI for Linux?

I'm setting up my first development Linux box - a netbook actually. I'm quite fond of MySQL Yog for Windows, but that's not on linux. I've checked these two threads What is the best free SQL GUI for Linux (MSSQL, MySQL, Oracle, Etc…) and Developer tools to directly access databases I'm not interesting in something large and resource hu...

How to implement memcached using a database ?

As far as I know, memcached runs in-memory and does not have a persistent backing-store. Currently my team is not ready yet to use memcached. So, I plan to write a simple database backed alternative. My question is pretty much in similar vein to this other question http://stackoverflow.com/questions/33619/concurrent-logins-in-a-web-f...

mysql join and limit

Hi, i have a master table page, and a relative table page_lang.In page_lang i hold the page data for each language. Using the the above code SELECT * FROM pages as p RIGHT JOIN pages_lang as l ON l.pageID=p.pageID i get the rows containing common data form pages and language data from page_lang.All OK The problem is when rty to lim...

Permissions for creating a trigger in mysql

mysql ver is 5.0.67 my trigger code is : DELIMITER // CREATE TRIGGER upd_price BEFORE UPDATE ON product_price FOR EACH ROW BEGIN INSERT INTO update_price_log (product_id, product_price_old, product_price_new) values(OLD.product_id, OLD.product_price, NEW.product_price); END // DELIMITER ; error is: #1227 - Access denied; ...

FCKEditor loses large amount of content on POST

Hi, So here's a very strange thing I've seen FCKEditor do: If there's a large amount of text pasted in it, it will simply drop it and empty itself upon POST for some very odd reason. I'm not sure what to debug to catch the error in my code or if it's just a limitation of the editor itself. Thoughts? I should say that it works just fine...

Is mysql_close required on connection failure?

I have a code snippet which connects to a MySQL database like this (not directly from code so there might be typos): m_connectionHandler = mysql_init(NULL); if (m_connectionHandler == NULL) { // MySQL initialization failed return; } MYSQL *tmp = mysql_real_connect(m_connectionHandler, m_hostname, ...

subsonic 3.0.0.3 doesent seem to update the database

hi there, im using subsonic 3.0.0.3 activerecord and everything is fine and i get no error but when i update a database, it never seems to actually happen, can anyone spot anything i am missing here?! ta code: var myquote = createNewQuote(); var gross = 36.00; myquote.totalcost = gross; // set the new value in my model UpdateModel...

tracking changes made in database structure

Hi all I'm fairly new to MySQL. I need to know how would i be able to track any changes in my database. I need a way to find out exactly what changes I made to the database so I can implement the same changes on another server. For example, if I added a new field in one of the tables, I would like to know what field that was so that I...

Finding the next available id in MySQL

I have to find the next available id (if there are 5 data in database, I have to get the next available insert place which is 6) in a MySQL database. How can I do that? I have used MAX(id), but when I delete some rows from the database, it still holds the old max value it didn't update. ...

PDO do not run same queries twice?

Good day! I'm trying to run the same update statement with the same params twice and it seems that it is not executed in the second case: $update_query = $this->db->connection->prepare('UPDATE `Table SET `field` = :price WHERE (`partnum` = :partnum)'); $update_query->execute(array('price' => 123, 'partnum' => test)); var_dump($update_...

Problems counting joined rows with conditional

I am having some problems with MySQL and selecting column count from a joined table. I have a feeling this is going to require a sub-select statement to fetch the rows I would like to join instead of doing it in my primary where condiutional. I am trying to select a list of project which are linked to a certain user. I would also like t...

MySQL MAX() and NULLs

Hi, I have a query that looks a bit like this: SELECT weekEnd, MAX(timeMonday) FROM timesheet GROUP BY weekEnd The valid values for timeMonday are: null, -1, 0, 1-24. At the moment, MAX() places the preference of those values in the order null, -1, 0, 1-24, however what I actually want is -1, null, 0, 1-24, so that null is considered...

MySQL SQL Subquery?

Given the following schema / data / output how would I format a SQL query to give the resulting output? CREATE TABLE report ( id BIGINT AUTO_INCREMENT, name VARCHAR(255) NOT NULL UNIQUE, source VARCHAR(255) NOT NULL UNIQUE, PRIMARY KEY(id) ) ENGINE = INNODB; CREATE TABLE field ( id BIGINT AUTO_INCREMENT, name VAR...

MySQL Query with PHP function compare?

Hello, What I want to do is while executing MySQL query, passing column data into a PHP function and comparing the result with WHERE clause... Something like that, I have the slug() function which I wrote in PHP and my query will be something like; SELECT * FROM articles WHERE slug(author) = "james-taylor"; So the query will select ...

What is the best way to clean public input?

So I have a form that accepts some input from a user that may at a later time be represented on the page. The way I'm thinking of doing this from a security point of view is to take the input, apply the mysql_real_escape_string() function to all input, then insert using a prepared statement. When retrieving the data, I'll do a htmlspec...

Approve submitted data

I notices more spam in my submitted data. How can I make a moderate stAge? For ex, user submits dAta to be entered mysql then I can approve before it is enetered into db where it would be automatically published. 9/11/2009: So I will test the Y/N method and then get back to u guys but I suspct I will have a problem with moderating (te...

sum in query / subquery

Table has the following info: date |vendor|sales|percent| -------------------------- 2009-03-03| 10 |13.50| 1.30 | 2009-03-10| 10 |42.50| 4.25 | 2009-03-03| 21 |23.50| 2.30 | 2009-03-10| 21 |32.50| 3.25 | 2009-03-03| 18 |53.50| 5.30 | 2009-03-10| 18 |44.50| 4.45 | I want it to sort into separate tables depending on d...

4 table join so that only 1 response is given for each company instead of a result for each campaign

Thanks for your help! I'd like to output all companyName entries that have uploads across any of their serverFiles as: companies.companyName - count(files.fileID) - sum(serverFiles.uniqueUploads) Initech Ltd. - 11 - 24931 Epiphyte Inc. - 23 - 938821 Here are the relavent parts of my table structure: Table: companies c...

MySQL SELECT most frequent by group

How do I get the most frequently occurring category for each tag in MySQL? Ideally, I would want to simulate an aggregate function that would calculate the mode of a column. SELECT t.tag , s.category FROM tags t LEFT JOIN stuff s USING (id) ORDER BY tag; +------------------+----------+ | tag | category | +-------...

Get SQL statement after parameters added

Is there a way (in MySQL) to get the pure SQL statement after parameters have been added? I'm having issues with one of my statements once I start using parameters, and I want to see what's being executed. Of course it has to do with dates. Using MySQL .NET Connector. I have access to MySQL server, and I use SQLYog to administrate. Tha...