dear all..i want to make some report which get data for one semester.
this semester started at april and finished at september in each year.
But for the second semester it will get data from october until march(next year).
how do i do to make this grouping or aggregation? i'm just now the basic query like:
select * from dt_tb where `dt`...
I have just finished creating my signup form and now ready to insert data into the datebase using doctrine. Everything inserts fine but in my var_dump my birthday dropdown is in 3 seperates... day , month and year.. I would like to combine them and post as "birthday" into the db with doctrine.
I wish to do this in my controller, please ...
Here's how Paul Graham describes the ranking algorithm for Hacker News:
News.YC's is just
(p - 1) / (t + 2)^1.5
where p = points and t = age in hours
I'd like to do that in pure mySQL given the following tables:
Table Posts with fields postID (index) and postTime (timestamp).
Table Votes with fields voteID (index), post...
I'm trying to figure out how to order items with matching tags by the number of tags that match.
Let's say you have three MySQL tables:
tags(tag_id, title)
articles(article_id, some_text)
articles_tags(tag_id, article_id)
Now let's say you have four articles where:
article_id = 1 has tags "humor," "funny," and "hilarious."
article...
Hello
Please! Help me with this!
I have QT 2010.05 and MySQL 5.1.50 (with the corresponding sources and libs) on XP.
I'm trying to insert an image into a BLOB field in a table like this:
CREATE TABLE `contenido` (
`idx_contenido` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(256) COLLATE latin1_spanish_ci DEFAULT NULL,
`con...
We have a products table. Users can create new products as copies of existing products.
Instead of simply duplicating this data, we're thinking in order to minimize database size, we would store only the differences from the "parent" product. (were talking thousands of products)
My thinking is that, for each new "child" product, we cre...
I have written a small PHP file that gets the information that was posted to it, then checks to make sure it is no empty. If it isn't empty, it checks to make sure the username doesn't already exist. If it does, it redirects. If not, it adds the information to the MySQL database. I don't know what the problem is, but when attempting to n...
For some reason, using DBI's bind parameter feature for the below AES key is causing a query to fail to find any rows.
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect('dbi:mysql:database=thedb;host=localhost');
my $aes_key = 'X`ku@wC_BI\SgY[S%/<iaB>&VXd5zDA+';
print length($aes_key), "\n";
my $test = $dbh->selectrow_hashref...
Can some one optimize this mysql query
SELECT submittedform.*, inspectors.first_name, inspectors.last_name
FROM (
SELECT `dinsp`,`departure`,`arrival`,'cabin' as type FROM cabinets
UNION
SELECT `dinsp`,`departure`,`arrival`,'cockpit' as type FROM cockpits
ORDER BY `date_of_inspection` ASC
) AS ...
I have numeric data with numbers representing the event that happened. Events can be public or private. I have 2 choices and I don't know which one to use (is faster).
I can make 2 columns, 1 is the event column and the values are like 1...10. The other is the public/private smallint column that says if the event is public or private.
...
OS is centos5.4. lua is 5.1.4. mysql-proxy is 0.7.1.
lua5.1.pc is already in /usr/local/lib/pkgconfig/
$PKG_CONFIG_PATH is /usr/local/lib/pkgconfig
why it shows error:
checking for LUA... no checking for
LUA... configure: error: Package
requirements (lua5.1 >= 5.1) were not
met:
No package 'lua5.1' found
when i configur...
Hi, We designed a search engine but it takes much time to execute its query in drupal.We have uploaded many modules in our search engine.So could you please guide what will be the remedy for make our search engine fast.Is there any thing that i can do with my site? Thanks In Advance
...
Hi friends,I have two tables.One table contain the values
+---------+
Users
---------+
A
B
C
D
E
F
+----------+
And in another table I am having
+--------+
Active
+--------+
C
D
G
H
I
`+--------+
From the two table I need to get the Users only those who are not in the Active.For this the expected result is
+------+
Result
+------+
A
B...
how we can update mysql detabase by using ajax...
any help or consept..
...
I often write little Python scripts to iterate through all rows of a DB-table.
For example sending all to all subscribers a email.
I do it like this
conn = MySQLdb.connect(host = hst, user = usr, passwd = pw, db = db)
cursor = conn.cursor()
subscribers = cursor.execute("SELECT * FROM tbl_subscriber;")
for subscriber in subscribers:
...
Hi,
I store money values in my db table. E.g. I have 2.50. But when I print that value the 0 is always missing so I get 2.5. The db table money field has the following type: decimal(6,2)
any idea how to fix that?
...
Hi,
My situation is i need to update 4 tables upon a request.
I execute four statements like a delete two inserts and one update.
What if in any given time after executing two queries the database fails or for any other reason the code exits (probably of any sort of db error/exception).
If that happens then many reference would get w...
Hi,
The question is simple: I want to do:
SELECT SUM((... a subquery that returns multiple rows with a single int value ...)) AS total;
How would I do that? I get an error saying that subquery returns more than one row. I need to have it in a subquery.
...
i want to make my table can filtering in each column. i get client side script from DataTable.net. To make this work, i must make change at server side script for this datatable. My table fields is: Line, Model_name, Version, Lot, Serial_number, ID_number, Lot_no_S_Serial, and Prod_date.
i have tried to syncronizing each column to this ...
I have 2 fulltext seach indexes, one for users and one for posts, every time a user signs up he gets added to that table for user_search and when when ever a user makes a post .. the post gets added to the post_search MYISAM table.
Now the thing is, I discovered that for some reason my latest inserted items are not appearing in search.
...