I've got a project were there are a number of select boxes that are loaded with reference data, ie customer types. To do this, I've create a seperate Controller that returns the data as a JSON result. This is called on page load via a jQuery function to load select list.
On submit to the customer controller, if an option has been select...
A single row in a table has a column with an integer value >= 1 and must be selected however many times the column says. So if the column had '2', I'd like the select query to return the single-row 2 times.
How can this be accomplished?
...
This has got to be a simple question, just brain-dumbing right now...
I've got one table, called 'foo'. It's got two columns, 'id' and 'username'.
The id is unique, but some of the usernames reference the same user; just one has a prefix on the username of 'xx_'.
ex:
ID USERNAME
1 bob
2 sam
3 xx_bob
How can I...
Hi,
I have a hopefully simple MySQL query question which is eluding me at late at night. I'm trying to do a SELECT which counts the number of instances of a set of data (orders) and groups those instances by a value which exists in a parent a couple levels above the order itself.
For example:
CREATE TABLE `so_test`.`categories` (
...
CREATE TABLE activities(activityid, name);
CREATE TABLE activity_scores(activityid, studentid, score);
CREATE TABLE students (id, name);
Is there any way to write a single SELECT query that will produce one result for each student, in this format?
studentid | studentname | activity1_score | activity2_score | activity3_score [...]
...
Could anyone tell me how to do the select function in SubSonic project to query all customer who will have birthday in next two week from today.
Table Customer
Name Thomas
DOB 19/09/1981
Thank you
...
While a send() succeeds with all data being sent most of the time, it is not always the case. Thus people are advised to use the write-fdset for select() and poll() to check when the socket is writeable.
How do usual mechanisms look like to actually buffer the data to send while still maintaining a well comprehensible sourcecode?
...
Background info:
I have a function that when called creates select list inside a form and populates it. After that the script runs through the options in the list and looks for a certain value. If the value is there, the script 'selects' that option.
Problem:
Because the list is dynamically created and is some times very large, it takes...
I have a java app here that starts a C++ app via the java.lang.Process API and then tries to send commands to it via the stdin pipe:
process.getOutputStream().write("foo\n");
process.getOutputStream().flush();
On the C++ side there's a loop running that checks for input in stdin and if there is some
it reads it. Unfortunately the che...
What is the best way to pick a random brush from the System.Drawing.Brushes collection in C#?
...
There is a Select overload that adds an index to each element of a sequence :
Dim Letters = new string() {"a","b","c","d","e"}
Dim IndexedLetters = Letters.Select(function (aLetter, index) new with {.Index = index + 1, .Letter = aLetter})
' For LINQPad users : IndexedLetters.Dump
Can this query be written in Query Notation ?
...
Consider the following table structure with data -
AdjusterID | CompanyID | FirstName | LastName | EmailID
============================================================
1001 | Sterling | Jane | Stewart | [email protected]
1002 | Sterling | David | Boon | [email protected]
1003 | PHH ...
I want to extract the Text inside a Element with JQuery
<div id="bla">
<span><strong>bla bla bla</strong>I want this text</span>
</div>
I want only the text "I want this text" without the strong-tag. How can I do that?
...
In mozilla and Non IE browsers, if the option of select list is of a greater length than the select's width, it will show up.But in IE. ,It will crop the option up to the select's width.Is there any wasy to make the IE's select's behaviour to be like that of NON IE browsers ?
...
Hi,
In order to choose categories, I want to use dropdown lists. Each list contains one level of categories. So it's: top level, sub, subsub, subsubsub etc. Every level is dynamically retrieved thru a script 'getcat.php'. It shows a object.
The retrieval so far works with the code underneath. However, Since it's form, i want to get th...
$result = $db_con->query("SELECT SQL_CALC_FOUND_ROWS * FROM users LIMIT 0,10");
$count_result = $db_con->query("SELECT FOUND_ROWS() as totalcount");
$row = $count_result->fetch_assoc();
$total = $row['totalcount'];
$total keeps returning 0 even though the $result contains all the user rows in it.
ini_set("mysql.trace_mode", "0");
I...
Hi,
For example, if I did:
SELECT * FROM Users WHERE UserId BETWEEN 100 AND 1
what would the results be?
Edit: Sorry, you're right, I should have specified. I didn't want to know the exact number of rows that would return, I just wanted to know if it would return rows that were between 1 and 100 or if it would return rows from min(U...
I have a form that I want to show a drop-down menu that shows a selection for the person's age. The range is from 18 to 99. How do I do it with the form select helper? Isn't it something like:
<%= f.select :age, ['18'..'99'] %>
...
After some struggle, I got upto the following code for my problem. However it still does not add selected to a chosen option. You can find my original question below.
Improved code, but it still does not work.
var $index = $('.drop').index(this)
// find drop index...
var $indexofmonth = $index + 1;
//alert($indexofmonth); // this works
...
I have to deal with a table where there is a set of fields each followed by a second field that will hold a suggested new value until this change is confirmed.
It looks a little like this:
refID field1 newField1 field2 newField2 ...
refID is an ID value that links to a master table. One row in the master table can have ...