mysql

iterate mysql fileds and update fields

Hi, my data in tables contains some spaces, so I am using this command to trim it update results set Field1 = trim(Field1); I am doing this manually for all the fields. Can anyone provide me with a common sql to automatically trim the total number of fileds in a table? Thanks, ...

PHP logon / logoff design question

I am thinking of implementing a small tracking system that will track users logon / logoff times and also track who is currently logged on. It all makes sense to me except for the tracking of when a user logs off. Its easy enough when a user clicks a "log off" button which calls a function that can update the database with the logoff tim...

mysql number of people assigned to a task

I have the following tables... Tasks People tasks_people ... and I want to get a list of tasks, with a count of people assigned to them. Note that a person can be assigned to a task more than once (on different dates). For some reason I dont seem to be able to manage it. Thanks for any help! ...

Why my BLOB field is still 13B - what I am doing wrong?

Hi, I would like to store the data in the MySQL BLOB field. I am using the following code: int length = (int)fs.Length; buffer = new byte[length]; int count; int sum = 0; while ((count = fs.Read(buffer, sum, length - sum)) > 0) ...

Float not correct in MySQL

Hi, I am entering '35444650.00' as a float into my MySQL and it keeps reformatting to 35444648.00, any help welcome... ...

How much real storage is used with a varchar(100) declaration in mysql?

If I have a table with a field which is declared as accepting varchar(100) and then I actually insert the word "hello" how much real storage will be used on the mysql server? Also will an insert of NULL result in no storage being used even though varchar(100) is declared? What ever the answer is, is it consistent accross different data...

How might I set up data plumbing for Silverlight to MySQL in my situation?

In short: What is a good method for setting up read-only data access from Silverlight to a MySQL database? Here are the details of my situation: I'm currently trying to set up a Silverlight application to present data from a MySQL database. Currently, I need to set-up read-only access to the MySQL database (I may set up other tables ...

Silverlight Application for the web - storing data on site

Hi all, I've made a little game as an application for the web in silverlight using C#, and I simply would like to save the top ten scores of any of the users that go on it. How can I write to a file and save it on my web hosting area? Is this possible? I think this would be the best way, because I only need to store a name and score (...

MySQL practical normalisation on large single table

I'm relatively new to PHP MySQL and have tasked myself on learning with the "hands on" approach. Luckily, I currently have a (very) large database all relating to coin data with one table to work with. It currently has the following columns (each row representing a single item [coin]): Group ItemNo ListNo TypeCode DenomCode PeriodCode A...

Very slow MYSQL query for 2.5 million row table

Hi, I'm really struggling to get a query time down, its currently having to query 2.5 million rows and it takes over 20 seconds here is the query SELECT play_date AS date, COUNT(DISTINCT(email)) AS count FROM log WHERE play_date BETWEEN '2009-02-23' AND '2020-01-01' AND type = 'play' GROUP BY play_date ORDER BY play_date desc; `id` ...

UTF-8, PHP and XML Mysql

I am having great problems solving this one: I have a mysql database encoding latin1_swedish_ci and a table that stores names and addresses. I am trying to output a UTF-8 XML file, but I am having problems with the following string: Otivägen it is being outputted as Otivägen when i vim the file. Also when opened it IE i get "An inv...

Not your usual MySQL4 + ODBC connection issue...

I've got a problem with ODBC that has me stumped, and I can't find an answer anywhere that addresses my problem. Short version: I can't connect to my MySQL4 installation on Ubuntu Jaunty from my WinXP ODBC System DNS, even tho I can connect just fine using the command line client both on that particular machine and others. Huge amoun...

CGI language choice

Ok, I've asked a few related questions here and only ended up with more questions and I realized now it's because I don't have enough background info. So I'll make it more generic: I need to make a simple web application. Static HTML/JQuery pages will send AJAX POST requests to some server side code, which will: Read the POST variable...

Java, MySQL: Is there a way to embed a MySQL server with a Java program?

One thing I love about .NET is the ability to have a database file along with the project. I know that using a SQLite database, this can be done, but did someone achieve this with a MySQL database backend? So for instance, if I run a java program, it should be able to start its own mini MySQL server and manipulate data. So essentially,...

Upgraded to SubSonic 2.2 and Missing MySQL Stored Procedures

Need some help with this one. I'm working on a site for a company that uses SubSonic 2.1, VS 2008, MySQL and C#. Their current SubSonic build doesn't support MySQL paging. In order to correct this, I've attempted to upgrade the project to 2.2. I've tried two different methods. Attempt #1 - Upgraded to 2.2 binary available on the site ...

MySql Query Browser Updating row issue

Hello Guys, I am unable to edit my table in MySqL Query Browser. I have the primary key defined, but I am still unable to edit. Is there anything else that I need? Thanks ...

Referencing MySQL Alias of Aggregate Column

Following up on my question summarizing-two-conditions-on-the-same-sql-table, I added a RATIO column that is simply one SUM(...) column divided by a second SUM(...) column: SELECT COMPANY_ID, SUM(CASE WHEN STATUS IN (0, 1) THEN 1 ELSE 0 END) AS NON_BILLABLE, SUM(CASE WHEN STATUS IN (2, 3) THEN 1 ELSE 0 END) AS BILLABLE S...

create mysql odbc connection through batch script

Hi, Is there anyway to create a System DSN enter for MYSQL database (windows OS), with silent installation of MySQL ODBC Drivers programatically either through batch script or any other language? If drivers installation is not possible , atleast automatic DSN entery would be helpful. Thanks, ...

How I can use mysql in C++?

I have searched a lot, all I found is a "mysql++" but I don't know how to install it. I don't have knowledge about libraries in C++! ...

SQL Retrieving the last record in a sql query

I need to retrieve the last record in a mysql database table - is there a command for this? ...