mysql

Problem with processing intermediate results in MySQL stored procedure

Dear all, i try to do a little weighting of my data by using a stored procedure. Basically this means multiplying certain columns with their respective weights and adding them up in the end. I have written the following stored procedure: CREATE PROCEDURE test () BEGIN DECLARE w1 DOUBLE; DECLARE w2 DOUBLE; DECLARE res1 DOUBLE; DECLAR...

MySQL_Python on Snow Leopard

Hi, I've tried to solve this myself searching and searching but I can't get it to work. :( I'm in Snow Leopard 10.6.4 and tried to setup my Django environment, first I upgraded my python to 2.6.5, installed django and then mysql_python. All seems to be smooth until I to connect to mysql using syncdb. Got this error/trace message: djang...

Check to see if certain fields have been filled out before a form is submitted.

Hi all, I have a form that is sending data to a MySQL database and I want to make sure several of the fields are not left blank. I think I can figure out how to do this with JavaScript, but my question is should I? When I made the database table that I am working with I made the fields that I want to make sure are filled out NOT NULL t...

What deficiencies, limitations or flaws do you feel exist with SQL and what would you change or add to it?

Have you encountered deficiencies, limitations or flaws while using SQL? I can think of several examples: Complicated queries/updates, SQL injection, etc. € Could you accomplish the same task easily with a different DML or programming language? Can you provide me with case examples of problems you have encountered or cases where for ex...

MySQL metadata for table rows

Hi, I have a question about how to save metadata for table rows. For example, I have a table which contains data about images items_images. id, INT(20) title, VARCHAR(255) date_added, DATETIME ... Now I want to add a voting system where users can vote "like" or "dislike" for the image items. Should I just add two new fields to the ite...

how to Exporter gae data to mysql ..

my 'College' model data is : my str_loader.py is : class MySQLExporter(bulkloader.Exporter): def output_entities(self, entity_generator): conn = MySQLdb.connect(host='localhost',user='root',passwd='root',db='test',charset="utf8") c = conn.cursor() for entity in entity_generator: c.execute("INSERT...

How can I connect to a MySQL database using Scala?

I'm working on a little project where I'd like to parse some data, and then put it into a database. I'm not working with Lift, and I haven't been able to find a standard way to do this. I'm fine writing the queries myself, but I'm not sure what to use to actually connect to the DB. ...

How can I join 3 tables with mysql & php?

check out the page [url]http://www.mujak.com/test/test3.php[/url] It pulls the users Post,username,xbc/xlk tags etc which is perfect... BUT since I am pulling information from a MyBB bulletin board system, its quite different. When replying, people are are allowed to change the "Thread Subject" by simplying replying and changing it. I ...

What WAMP server is the best?

What WAMP server is the best? ...

Scalability of Using MySQL as a Key/Value Database

I am interested to know the performance impacts of using MySQL as a key-value database vs. say Redis/MongoDB/CouchDB. I have used both Redis and CouchDB in the past so I'm very familiar with their use cases, and know that it's better to store key/value pairs in say NoSQL vs. MySQL. But here's the situation: the bulk of our applicatio...

How can I output a row with id lets say 31.

<?php $link = mysql_connect('localhost', 'username', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; if (!mysql_select_db('database')) die("Can't select database"); // choose id 31 from table users echo $id; //31 echo $name; //id31's name echo $surname //id31's surname e...

Is there a mature way to interface Erlang and PostgreSQL or MySQL?

I have searched the internet for drivers to connect to either database and all the projects I have seen have either been dead for a long time, look incomplete, or don't have good enough documentation to be usable without reading all the source. Has anyone used Erlang to talk to either MySQL or PostgreSQL before and what sort of package ...

How to display date and price in a MySQL database and display it in various formats in PHP

I am a php/mysql novice so I have been inserting dates in whatever format I usually display dates on my pages, like: Saturday, June 19, 2010 directly into the database in plain text. But I have seen people enter it in some other way and then display that same record in various formats using some php function. What is the way to do thi...

Would a built-in multi-threading capability for SQL be desireable?

For example: Being able to start displaying or manipulating rows as they are being returned by a query while the query has not finished searching the table?.. and I don't mean using the FIRST ROWS directive to hint the engine, I mean transparently, without having to add addtional logic. A feature like this would be useful for queries whi...

Is ROWID internally indexed unique by an SQL server?

It's my understanding that the quickest way to access a particular row is by its ROWID. In INFORMIX-SE 7.3, when I do a 'SELECT ROWID FROM table;' I notice that its values are type SERIAL[INT]. In oracle, they are SERIAL[HEX]. Has anyone ever used ROWID for any practical use?.. If I wanted to locate the most recent row added to a table, ...

msql table name with $ sign

I have tables in Mysql 5 db with names prefixed with a dollar sign '$' ie tablename $MYTABLE I am using Spring 3.0 JdbcTemplate to do my select query but couldn't get it to work. ie String tablename = "$AAPL"; private static final String STOCK_SELECT = "select symbol, open, high, low, close, vol, ev from ?"; jdbcTem...

Database responsibility

Hello everybody. I'm starting with Databases. I've been playing around with MySQL and Informix, but never had a real life project. What is the real responsibility of a Database? Should we add Store procedures and functions to de Database or just let it to be a data repository with no logic? ...

How to find least non-null column in one particular row in SQL?

I am trying to find the lowest number in two columns of a row in the same table, with the caveat that one of the columns may be null in a particular row. If one of the columns is null, I want the value in the other column returned for that row, as that is the lowest non-null column in this case. If I use the least() function in MySQL 5.1...

How to add multiple OR in MySQL query

Example DB structure (download table) id | pid | title ---------------------------------------------------- 1 | 3,4,5 | Download 3, Download 4, Download 5 ---------------------------------------------------- 2 | 3 | Download 3 ---------------------------------------------------- Here is my code <?php $pid = explode(",...

scheduled event

what does this query do? CREATE EVENT reset ON SCHEDULE EVERY 1 DAY STARTS '2010-6-20 00:00:01' DO UPDATE `MY_DB`.`MY_table` SET `field` = '0'; ...