mysql

Showing all duplicates, side by side, in MySQL

I have a table like so: Table eventlog user | user_group | event_date | event_dur. ---- ---------- --------- ---------- xyz 1 2009-1-1 3.5 xyz 2 2009-1-1 4.5 abc 2 2009-1-2 5 abc 1 2009-1-2 5 Notice that in the above samp...

Best SCM practices for live databases

I've been building out an SCM environment (that has to be PCI compliant, but that's tangential to this issue). I've got to the point where I want to automate database updates, but I'm not 100% sure that's the best way forward. Say I want to add a field to a DB table. Easy enough to add it to the dev environment, but what about rolling ...

how can i able to delete the n'th ROW in a table using mysql query

Hi, Is there any way to delete the n'th ROW of a table using MYSQL Thanks in Advance Fero ...

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: in mysql

Hi I have created jdbc program and database is MySQL 5.1 Also all my friends using same database for connection. Total number of connection became 150 from all of us. So when i want to connect more then i got the following error com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database...

windows cmd connection to remote mysql dbf

is there a way of how to connect to mysql dbf on a remote server and run sql queries using windows command line? ...

mysql datareader

Hello Sir, I am using MySql 5.0. I using Mupliple datareader in same connection i get error message. Is possible to use multiple Datareader in same connection? I using Mysql Connection is MySqlConn.ConnectionString = "SERVER=" & gServerName & ";DATABASE=" & DBname & ";user=" & gUserName & ";password=" & gPassword & ";MultipleActi...

Restricting access to a site using IP address

I would like to know whether there is a way of restricting the users of a site such that they can only access the inner pages of a site if they are within a certain range of IP addresses or a certain network? The current PHP scripts I am getting cant differentiate the real IPs from the Proxies? Thanks ...

using where and inner join in mysql

I have three tables. locations ID | NAME | TYPE | 1 | add1 | stat | 2 | add2 | coun | 3 | add3 | coun | 4 | add4 | coun | 5 | add5 | stat | schools ID | NAME 1 | sch1 2 | sch2 3 |sch3 school_locations ID |LOCATIONS_ID |SCHOOL_ID 1 | 1 |1 2 | 2 |2 3 | 3 |3 Her...

MySQL delete all results of sub-query

Tonight may be the night I crack... Okay, so if you would like a back story, look at my previous question I have finally decided that if this is possible, It's not worth the time it will take to figure out, since I really should have had this done before tonight anyway. So I decided to go another route: Figuring out which of my record...

How does row design influence MySQL performance?

I got an users table and some forum, where users can write. Every action on forum uses users table. User can have a profile, which can be quite big (50KB). If I got such big data in each row wouldn't it be faster to have separate table with user's profiles and other data that aren't accessed very often? In an online RPG game each charac...

How to compare a date from mysql with current date and send a notification email

I have database entrys that have a date column ( mySQL date type ). I want to compare that date with the current server date and with 3 days before that day, every month, to automatically send an email to a specified address. ...

I want to compare the current date of my server with a date stored in a mySQL database

How can I compare the current date of the web server with a date I have stored in the mySQL database and 3 days before that that in the database to send a notification email ? ...

mysql oledb driver

how to install mysql oledb driver in local system. please give Mysql oledb Connection string ...

The algorithm to check private message in a SNS website.

Currently,I do it in a straightforward way, that is, when user loads every page, we check once. we check it by directly query the private_message table. Any better/efficiency way? ...

database structure

I'm building a gambling-related website where people can be on soccer fixtures (matches). A fixture ends up with a result: home win - draw - away win. I have one table for teams and one table for fixtures and another for bets. The fixtures table has a home team and an away team. But how do I model a draw bet? It's easy to have the bet t...

c# windows app OK in debug mode, faulty in release mode...

Hi, I've written a c# windows app, that performs some DB intensive operations. (MySQL connector v6). When running the project in Debug mode, everything works fine. However, when I run the prject in release mode, it sometimes quits operation midway - with no error message, nothing in the event logs etc. What would be the best way to ...

Database model and calculated balance, mysql

Another question from an app programmer who's trying the first time to get together a DB model himself. In my app, there are users, accounts and transactions. I initially had all tables in 3NF (or so I believe). Then I decided to add a balance field to users, mainly because my code will go open source and I do not want people to mess up...

Creating JSON in php

It seems like I would be jumping through hoops to move data from MySQL into json via PHP json_encode - the encoding is taken care of, it's the pulling of the related data from the database and ensuring that you have array within array within array setup correctly (code snip below)...is there a json framework or something where you feed i...

Use of MD5(URL) instead of URL in DB for WHERE.

I have a big MySQL InnoDB table (about 1 milion records, increase by 300K weekly) let's say with blog posts. This table has an url field with index. By adding new records in it I'm checking for existent records with the same url. Here is how query looks like: SELECT COUNT(*) FROM `tablename` WHERE url='http://www.google.com/'; Curren...

How can I add an additional condition to this query (using CASE) ?

Here's my query so far: SELECT posts.title , SUM(CASE comments.status WHEN 'approved' THEN 1 END) AS commentsCount FROM posts INNER JOIN comments ON comments.postID = posts.id WHERE posts.status = ? GROUP BY posts.title ORDER BY commentsCount DESC ...