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...
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...
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...
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...
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...
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...
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.
...
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?
...
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...
<?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...
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 ...
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...
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...
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, ...
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...
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?
...
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...
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(",...
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';
...