mysql

Complicated MySQL Query For Wordpress

Sometimes I think I haven't got the brain power for programming, I just can't get my head round this. I've got a table called wp_postmeta which looks kind of like this +-----------+-----------+------------+--------------+ | meta_id | post_id | meta_key | meta_value | +-----------+-----------+------------+--------------+ | 1 ...

hibernate: create table with names in lowercase

Hibernate: I want to have hibernate automatically generate my tables with names in lowercase. For example, if my class is called com.myapp.domain.Customer, hibernate will generate a table named Customer. I want it to be called customer. I know I can use the @Table annotation to specify the table name per class. But I want it to happen "...

(Game Engine) Framework Design

Hi there, I am currently working on 2D browser game. After putting the ZendFramework away, my team and I decided to write our own framework. Now we are helpless, because none of us has ever developed anything similar, except CMS frameworks etc. The language is PHP and the database driver used for it is MySQL(i, PDO, etc) Can you giv...

MySQL connection timeout - MySQL server has gone away (Sinatra, ActiveRecord)

Hi, Here is an outline of my app: require 'sinatra' require 'active_record' ActiveRecord::Base.establish_connection( :adapter => "mysql", host => $DB_HOSTNAME, :database => $DB_NAME,:username => $DB_USERNAME,:password => $DB_PASSWORD) class Sometable < ActiveRecord::Base end get '/' do #stuff with Sometable end # a lot ...

How to store data into MySQL database?

I have created a java application which stores data into MySQL database. For that I have done the following things: I have installed MySQL database on my computer. I have created a database on that MySQL server. I have created a table in the database with the required schema. Now I want to deliver this application to various clients...

MySQL Order by math

Hello There, I want to order a result by fieldx * fieldy, for example: Row 1: fieldx = 10 fieldy = 10 Total: 100 Row 2: fieldx = 11 fieldy = 5 Total: 55 Row 1 has to appear first. Couldn't find anything about it. It's for a codeIgniter project, so if there is a solution with that I'm very happy. Thanks! ...

When do i use inner joins and when do i use subqueries?

What is the difference between an inner join and a subquery? and when should i use a subquery? or an inner join? I was in a situation recently where an inner join was too slow and subquery was the solution. From my limited understanding i thought the two worked exactly the same. ...

Asking for everything "up to" a value [MySQL]

If I would like to: SELECT * FROM `Students` ...from age 0 to 20, how would I do this? ...

Backing Up Views with Mysql Dump

Hi, I want to back up only the Views with mysqldump. Is this possible? If so, how? ...

How do I restore the MySQL root user's privileges?

I accidentally removed most of the privileges from my MySQL root user, including the ability to grant privileges. Is there some way I can restore this user to its original state? ...

What is a good free RDBMS solution for a small web project that may grow large if successful?

As a C# developer that uses MS SQL Server heavily I'd prefer to use what I know; however, for a small project the licensing costs are prohibitive and so I'm looking at using a free open source solution such as MySQL. Which of the free RDBMS solutions are the best in terms of stability, performance, features and ease of use for someone fa...

Are mysqli_multi_query php function connect 1 time to db or each query?

Hey Guys, Just wonder if the function mysqli_multi_query connect just 1 time to the database or each query? ...

Many-to-many relationships in Django - mysql's ISNULL() equivalent

Hello! I have two models that are basically this: Book(Model): title = models.CharField(max_length = 250) read_by = ManyToManyField(User) ... User(Model): firstName = models.CharField(max_length = 250) lastName = models.CharField(max_length = 250) ... Now, how do I create a list of all books with a "read" b...

Doesn't Equal in SQL

Hi Everyone: I am wondering if there is some way to do a doesn't equal command in MYSQL. In other words, can you do a command like this: "SELECT * FROM someTitle WHERE someLabel != 'something'"? My code is returning an error when I attempt this. Thanks for any help! ...

How to query MySQL DB from client in a secure manner

I'm doing a personal number-crunching project, and I'd like to launch multiple programs on multiple computers (maybe even on Amazon's servers someday), and have them all storing and sharing data in a common SQL database, located on my web hosting account. The hosting company won't allow foreign connections directly to the SQL server, bu...

mysql column data copy from one table to another with a join?

Having trouble figuring out the syntax for this one... :-/ Table 1 ID FEE FAI FOE 0 Fee1 Fai1 Foe1 1 Fee2 Fai2 Foe2 2 Fee3 Fai3 Foe3 Table 2 ID FEE FAI FUM - Fee1 Fai1 Fum1 - Fee2 Fai2 Fum2 - Fee3 Fai3 Fum3 Based on the shared columns FEE and FAI, which when combined form unique pairs, I'd like to...

MySQL: Create user with rights only for specific db

Hi, I would need to create MySQL user programatically with the privileges only for specific db. Say there are databases a,b,c and I would need to create user who has rights only for B. I am sure its possible but my googling was not successful. Thank you! ...

Is it possible to Update single/multiple columns using "group by".

Hi All, I am running group by on 4 columns of two tables. I have unique ID column in two tables. I want to mark both the tables occurrences column to SINGLE/MULTIPLE based on the 4 columns. Is there any way to update based on the results of group by?. ...

mysql java versus c program, difference in characters stored.

Hello, I have two programs- First one being a C program that writes in to mysql database. Second is a java program that reads the data from mysql database. The C program reads list of files in a particular directory and inserts the file names in DB. The Java program reads these rows and tries to do some file processing using these fil...

Optimising Mysql Databases

I am planning to research how to improve my Databases (in speed , quality,queries ,transaction , indexes ) and i would like to know what are the best books for that. I would like the links to the books on where I could download them/buy. I wanna find out how to improve the speed on my database engine , what mistakes should I avoid or wh...