In a form_tag, there is a list of 10 to 15 checkboxes:
<%= check_box_tag 'vehicles[]', car.id %>
How can I select-all (put a tick in every single) checkboxes by RJS? Thanks
For example I have type:
CREATE TYPE record AS ( name text, description text, tags text[])
And table:
CREATE TABLE items ( id serial, records record[] )
How can I select all items with records with tags 'test' (without using PL/pgSQL)?
Regular HTML select boxes (such as, e.g. found here), while being "chosen" are presented by the iPhone on a native widget that seems to totally ignore regular html font sizes and whatnot. It does some ellipsing when it goes too long, but the font is way too big for a list I want to present -- even on landscape, only about 35 characters can fit.
Is there any way to tell the iPhone to use a smaller font there?
I have this table
<table class="results" id="summary_results">
<tr>
<td>select all</td>
<td>name</td>
<td>id</td>
<td>address</td>
<td>url</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>john doe</td>
<td>1</td>
<td>33.85 some address</td>
<td>http://www.domain.com</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>jane doe</td>
<td>2</td>
<td>34.85 some address</td>
<td>http://www.domain2.com</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>sam</td>
<td>3</td>
<td>33.86 some address</td>
<td>http://www.domain3.com</td>
</tr>
</table>
I would like to select all the rows then download the content of the urls knowing that each url is linked to the id. for example the first url will be www.domain.com?id=1&report=report
This Query is giving me an error of #1054 - Unknown column 'totalamount' in 'where clause'
SELECT (amount1 + amount2) as totalamount
FROM `Donation`
WHERE totalamount > 1000
I know i can resolve this error by using group by clause and replace my where condition with having clause. But is there any other solution beside using having clause. If group by is the only solution then I want to know why I have to use group by clause even I havent use any aggregate function
thanks.
$('#bit_IsModule').click(function () {
if ($('#bit_IsModule:checked').val() == "true")
$("#featurename").slideUp();
else
$("#featurename").slideDown();
});
I want to disable the first value in the select list on the checkbox click ? how can i do that
I have a email address like [email protected] and [email protected][email protected] ... etc
I want a Mysql select query so that it would trim user names and .com an returns output as
gmail,ymail,hotmail etc
I have some valid select statements that when I send to MSSQL2005 sometimes return the error "Cursor not returned from Query".
How can I trace this and find out what's wrong?
Thanks
I have Canine and CanineHandler objects in my application. The CanineHandler object has a PersonID (which references a completely different database), an EffectiveDate (which specifies when a handler started with the canine), and a FK reference to the Canine (CanineID).
Given a specific PersonID, I want to find all canines they're currently responsible for. The (simplified) query I'd use in SQL would be:
Select Canine.*
from Canine
inner join CanineHandler on(CanineHandler.CanineID=Canine.CanineID)
inner join
(select CanineID,Max(EffectiveDate) MaxEffectiveDate
from caninehandler
group by CanineID) as CurrentHandler
on(CurrentHandler.CanineID=CanineHandler.CanineID
and CurrentHandler.MaxEffectiveDate=CanineHandler.EffectiveDate)
where CanineHandler.HandlerPersonID=@PersonID
Edit: Added mapping files below:
<class name="CanineHandler" table="CanineHandler" schema="dbo">
<id name="CanineHandlerID" type="Int32">
<generator class="identity" />
</id>
<property name="EffectiveDate" type="DateTime" precision="16" not-null="true" />
<property name="HandlerPersonID" type="Int64" precision="19" not-null="true" />
<many-to-one name="Canine" class="Canine" column="CanineID" not-null="true" access="field.camelcase-underscore" />
</class>
<class name="Canine" table="Canine">
<id name="CanineID" type="Int32">
<generator class="identity" />
</id>
<property name="Name" type="String" length="64" not-null="true" />
...
<set name="CanineHandlers" table="CanineHandler" inverse="true" order-by="EffectiveDate desc" cascade="save-update" access="field.camelcase-underscore">
<key column="CanineID" />
<one-to-many class="CanineHandler" />
</set>
<property name="IsDeleted" type="Boolean" not-null="true" />
</class>
I haven't tried yet, but I'm guessing I could do this in HQL. I haven't had to write anything in HQL yet, so I'll have to tackle that eventually anyway, but my question is whether/how I can do this sub-query with the criterion/subqueries objects.
I got as far as creating the following detached criteria:
DetachedCriteria effectiveHandlers = DetachedCriteria.For<Canine>()
.SetProjection(Projections.ProjectionList()
.Add(Projections.Max("EffectiveDate"),"MaxEffectiveDate")
.Add(Projections.GroupProperty("CanineID"),"handledCanineID")
);
but I can't figure out how to do the inner join. If I do this:
Session.CreateCriteria<Canine>()
.CreateCriteria("CanineHandler", "handler", NHibernate.SqlCommand.JoinType.InnerJoin)
.List<Canine>();
I get an error "could not resolve property: CanineHandler of: OPS.CanineApp.Model.Canine". Obviously I'm missing something(s) but from the documentation I got the impression that should return a list of Canines that have handlers (possibly with duplicates). Until I can make this work, adding the subquery isn't going to work...
I've found similar questions, such as http://stackoverflow.com/questions/747382/only-get-latest-results-using-nhibernate but none of the answers really seem to apply with the kind of direct result I'm looking for.
Any help or suggestion is greatly appreciated.
How can you select an element that has current focus?
There is no :focus filter in jQuery, that is why we can use something like this:
$('input:focus').someFunction();
I want to do the following dynamically
Generate numbers from 1 to 100 and then select 25 random numbers from it and display it in a console. Any easy way to do so?
I have to query a view and include only those columns which are defined in the XML which comes as a parameter to my SP. Can i include that XML in select clause and extract all columns defined in that XML. Please tell a way to do this.
I have
[Person]
PersonID, EmailAddress, FirstName, LastName
[OnlineAccount]
OnlineAccountID, PersonID, Nickname
Each person is allowed to have 0-* OnlineAccount.
In entity framework with C#, how do I select the top 5 Person that has the most accounts?
Is it real and how can I think about it.
To make so the user will select only the month and year, not date, because he need a period on full month, not some date.
here is simple control ...
<asp:TextBox ID="TextBox3" runat="server" />
<asp:CalendarExtender ID="TextBox3_CalendarExtender" runat="server"
Enabled="True" TargetControlID="TextBox3" />
I have a sequence relationship:
A has many Bs.
B has many Cs.
C has many Ds.
They also make me so confused if there are more than 3 or 4,..tables.
So, how can i select all Cs that satify A.Id="1".
(something likes finding all grandsons of a grandfather)
Thanks in advance.
I'm creating a little management tool for the browser game travian. So I select all the villages from the database and I want to display some content that's unique to each of the villages. But in order to query for those unique details I need to pass the id of the village. How should I do this?
this is my code (controller):
function members_area()
{
global $site_title;
$this->load->model('membership_model');
if($this->membership_model->get_villages())
{
$data['rows'] = $this->membership_model->get_villages();
$id = 1;//this should be dynamic, but how?
if($this->membership_model->get_tasks($id)):
$data['tasks'] = $this->membership_model->get_tasks($id);
endif;
}
$data['title'] = $site_title." | Your account";
$data['main_content'] = 'account';
$this->load->view('template', $data);
}
and this is the 2 functions I'm using in the model:
function get_villages()
{
$q = $this->db->get('villages');
if($q->num_rows() > 0) {
foreach ($q->result() as $row) {
$data[] = $row;
}
return $data;
}
}
function get_tasks($id)
{
$this->db->select('name');
$this->db->from('tasks');
$this->db->where('villageid', $id);
$q = $this->db->get();
if($q->num_rows() > 0) {
foreach ($q->result() as $task) {
$data[] = $task;
}
return $data;
}
}
and of course the view:
<?php foreach($rows as $r) : ?>
<div class="village">
<h3><?php echo $r->name; ?></h3>
<ul>
<?php foreach($tasks as $task): ?>
<li><?php echo $task->name; ?></li>
<?php endforeach; ?>
</ul>
<?php echo anchor('site/add_village/'.$r->id.'', '+ add new task'); ?>
</div>
<?php endforeach; ?>
ps: please do not remove the comment in the first block of code!
Have a requirement to select the 7th column. eg:
cat filename | awk '{print $7}'
The issue is that the data in the 4th column has multiple values with blank in between. example - The last line in the below output:
user \Adminis FL_vol Design 0 - 1 -
group 0 FL_vol Design 19324481 - 3014 -
user \MAK FL_vol Design 16875161 - 2618 -
tree 826 FL_vol Out Global Doc Mark 16875162 - 9618 - /vol/FL_vol/Out Global Doc Mark
I need to fetch only first record (because I need last date) of resultset, at the moment I have this resultset from this sql tring:
SELECT BCACC,FLDAT
FROM ANAGEFLF
ORDER BY FLDAT DESC
and I see this record:
A.M.T. AUTOTRASPORTI SRL 20080220
A.M.T. AUTOTRASPORTI SRL 20080123
A.M.T. AUTOTRASPORTI SRL 20070731
APOFRUIT ITALIA 20080414
APOFRUIT ITALIA 20080205
APOFRUIT ITALIA 20071210
APOFRUIT ITALIA 20070917
APOFRUIT ITALIA 20070907
now I need to take only one record (first) for every BCACC, I would take this resultset:
A.M.T. AUTOTRASPORTI SRL 20080220
APOFRUIT ITALIA 20080414
I've just try group it for BCACC but I receive an sql error, I'm workin on DB2 ibmI
I have a table like this
C1 C2 C3 Code
1 2 3 33
1 2 3 34
2 4 1 14
1 2 3 14
i want to select only those record whose code is appearing only in single row. ie, in this case rows with code 33 and 34.. as they appear only once in this table.
How can i write a query for that
I am open iphone photo library from the my application.And i am selecting photo in squre shape.Its fine.But i want select photo in round shape.How it possible?
Is it posibble to select 3 tables at a time in 1 database?
Table 1: employee
-- employee_id
-- first_name
-- last_name
-- middle_name
-- birthdate
-- address
-- gender
-- image
-- salary
Table 2: logs
-- log_id
-- full_name
-- employee_id
-- date
-- time
-- status
Table 2: logout
-- log_id
-- full_name
-- employee_id
-- date
-- time
-- status
I wanted to get the value of employee table where $id of selected. Then the $id also get the value of log.time, log.date, logout.time, and logout.date.
I already try using UNION but nothing happens.
{"names": [
{"patientName": "Ratna"},
{"patientName": "raju" },
{"patientName": "krishna"},
{"patientName": "kishore"},
{"patientName": "Kishore1"},
{"patientName": "mahesh"}
]}
this is the JSON object i'm getting from Ajax call
so now i want to add all patientName values to select box through jquery
can any one tell me how to accomplish this ??
here i'm using $.ajax() function for ajax call
thanks in advance