select

multiple updates with one click

Imagine there are table in the page with info that few people have sent in. Someone else has to updete that info selecting an option from select menu. It selecst one option from teh list for each row and then updates info by pressing submit button. How can I update multiple entries in database with one click? It easy to do with checkboxe...

How to select an QGraphicsItem without selecting whole group (to which this item belongs)

I wonder if it is possible to select item that belongs to one group, without selecting whole group. What I trying to make is a group of items, that can be moved (all items are moved together) but none of them can't be moved individually. But I want also to be able to select items inside this group and then do something with them, like r...

Rails 3 - select with Include?

I've been looking for how to do a select with include in Rails 3 - I have a nested example: @items = Item.where("fulfilled = ?", true).includes({:order=>[:supplier, :agent]}, :manufacturer) This is a very taxing query to run without selects as it creates 1000s of rows of data by pulling information from all the above big tables. How ca...

Modifying selection algorithm to select weighted items

Hi guys, I am attempting to modify the selection algorithm to work with the following situation: My imput is a list of numbers x1, x2, ... , xn (not necessarily ordered). Each of these numbers has a weight "w". I call W the sum of all the weights. If I provide a value X, which is greater than 0 but no larger than W, how can I find a ...

MySQL Select And Count Date Range: Doesn't work crossing the month barrier

Hi Can you please tell me why this works: $customer_data_date14daysAgo = mysql_query("SELECT COUNT(*) AS count FROM tableName WHERE datetime BETWEEN '$date14daysAgo%' and '$dateToday%' ") or die(mysql_error()); But this doesn't? $customer_data_date30daysAgo = mysql_query("SELECT COUNT(*) AS count FROM tableName WHERE datetime BE...

How do you select data from multiple tables with kohana ORM V3

Hi I can't seem to select data from multiple tables with kohana orm. When I do: $obj = orm::factory('a') ->join('b') ->on('a.b_id','=','b.id') ->select ('b.','a.') ->find_all(); The only variables available in $obj are from table a. Can someone help? ...

Selecting two counts on two joins in one query

create table Autorzy(ID int, imie varchar, nazwisko varchar); create table Wydawnictwa(ID int, nazwa varchar, adres varchar, tel varchar); create table Ksiazki(ID int, ISBN bigint, wydawnictwo_id int, data date, ilosc int, tytul varchar); create table KsiazkaAutor(ID int, autor_id int, ksiazka_id int); create table Recenzje (id int, tres...

How do I get several highest values from a table?

I have a table like id f1 -------------- 1 2000-01-01 1 2001-01-01 1 2002-01-01 1 2003-01-01 And I want to get say the latest 3 dates in one row CREATE TABLE Test ( id INT NOT NULL, f1 DATETIME NOT NULL, ) INSERT INTO Test (id, f1) VALUES (1, '1/1/2000') INSERT INTO Test (id, f1) VALUES (1, '1/1/2001') INSERT INTO Test...

jquery - update href based on select value?

I'm trying to assemble an href tag based on values a user selects from a select menu. This is the code I have, which isn't working. I'm pretty new to jQuery, so, if someone can help me out or suggest a better way, that'd be great... $(document).ready(function() { if($('#addtocalendar-selects').length) { $("select.addCalselect")...

Javascript: Remove different option-tags from a dropdown list depending on another dropdown?

Yeah, the title is a mess. Here's what i'm trying to do: I have one main dropdown list where i can choose between, let's say, two options. Option1, and Option2. If Option1 is selected, i don't want anything to happen. If Option2 is selected, i want to remove one option-tag from another dropdown list. <select name="main_dropdown"> <...

Select prompt option disappears when validation fails in Rails

Let me preface by saying I'm a noob to Rails and StackOverflow so please go easy on me. I'm using Rails 2.3.8 with sqlite3 on my dev box. I have created a select pulldown in a form using the following: <%= select( "communication", "gig_id", { "Add New Gig" => "new"}, {:prompt => "-- Select Gig --"}, :onchange => "toggle(this, 'gigInfo...

How can I highlight certain options in a HTML select - using javascript

Hello, I saw this post: http://efreedom.com/Question/1-1161772/Can-Highlight-Certain-Options-HTML-Select-Using-JQuery which is similar to what I need to do, except a bit too complicated for my understanding. In the html body, I have a dynamically changing select form. The user can select multiple items from this form, and click a b...