select

Nested case in bash script

I have written the following function in a bash script but it is not working. Am I missing something obvious? main_menu() { dialog \ --title "Sim Gateway Infomation Utility" \ --menu "What do you want to do?" 12 60 5 \ Summary "View overall summary" \ Details "View details of a sim bank" \ Modify "Modify used minutes...

Why doesn't Firefox show the correct default select option?

I'm making a web app to manage product SKUS. One part of that is to associate SKUs with product names. On each row of a table, I list a SKU and display a <select> box with product names. The product that's currently associated with that SKU in the database is given an attribute like selected="selected". This can be changed and updated vi...

yield return versus return select

Which are the advantages/drawbacks of both approaches? return items.Select(item => DoSomething(item)); versus foreach(var item in items) { yield return DoSomething(item); } EDIT As they are MSIL roughly equivalent, which one you find more readable? ...

Sql Server 2008 - How can I select all rows and update a field with its hash code?

Hi everyone! In my project, I'm in a point that is lack of knowledge of sql programming. I have a tbUsers with a passowrd field. But, now I have to trasnform them to hash MD5, so far so good for the hash. But, how can I select all passwords recorded and update them with its hashvalue? I don't really need the hashvalue part, just the se...

Selecting table columns (jQuery)

I want to give ALL (including ) cells of FIRST and LAST columns some specific classes, I tried this: $("table tr:first-child td:first-child").addClass("first-col-cell"); $("table tr:last-child td:last-child").addClass("last-col-cell"); ..but it doesn't seem to work. Would appreciate any help. Thanks! ...

select text with range object in iframe, is is possible ?

i have selected text from range object. is it possible to "select" text again, using the range object, if i deselect it (click somewhere) ? text is in iframe. thanks, here is code: var iframe_window = window.frames["iView"]; iframe_content = iframe_window.document.getElementsByTagName("body")[0].innerHTML; iframe_document = iframe_...

MySQL: Update all Columns With Values From A Separate Table

Sometimes if I want to quickly copy records from one table to another (that has the same structure) I use a query like this: INSERT INTO table2 SELECT * FROM table1 WHERE id = SOME_VALUE How can I add a ON DUPLICATE KEY UPDATE to this statement? I tried this: INSERT INTO SELECT * FROM table1 WHERE id = 1 ON DUPLICATE KEY UP...

Jquery Add Values to Select

I Want to add Options to Select Box using jquery, but my options comes from MYSQL databse table here is method what i want: function add_inst(va) { alert(va); } <select id="test"> </select> I want to select values from MySQL table with match value of va, then add these result as options to select id="test". For example if i pas...

How to SELECT items from from an array (IN clause details)?

I would like to do something in Java (using iBatis, JDBC, etc., really in SQL) like: SELECT SUM(rowName) FROM myTable WHERE id = [myArrayOfIds] Where myArrayOfIds can be almost any length. Now I know you can do: SELECT SUM(rowName) FROM myTable WHERE id IN (x, y, z) but what happens for longer lists? For example my list could be as...

html: div and select tag

Can I have a <DIV> within an HTML <SELECT> tag, e.g.: <select tabindex="2" name="agegrp" id="agegrp" > <div> <option value="-1">No preference</option> </div> </select> ...

Jquery Add Values to Select Options

i have google this option many days but i did't find it. what i want is: I have two Select BOX First Select box Have Country Names Second Select Box is Empty what i want is when i select any country (i.e United Kingdom) from first select box, a php query should run to get all cities name from table then add them to second select bo...

Simple SQL select in C#?

On my current project, to get a single value (select column from table where id=val), the previous programmer goes through using a datarow, datatable and an sqldatadapter (and of course sqlconnection) just to get that one value. Is there an easier way to make a simple select query? In php, I can just use mysql_query and then mysql_resul...

Dragging a copy of all selected elements from a select box--possible?

I have a picklist web interface: a pair of select elements with a pair of buttons (a left-pointing arrow and a right-pointing arrow) between them. Users can move items between the two columns by, eg, selecting one of options in the left column and clicking on the right-pointing arrow. Now I have an enhancement request: someone wants to...

MySQL - Selecting records based on maximum secondary ID

Here's part of my table: id team_id log_id 1 12 1 2 12 1 3 12 1 4 12 1 5 1 2 6 1 2 7 1 3 8 1 3 What query would produce this output (so only the records with the highest log_id values are returned that correspond to ...

Crystal Reports compare does not work without trim

{AR_Customer.CustomerType} is a 4 character field {AR_Customer.CustomerType}<>"S" does not return all records where this is true unless I do it this way: trim({AR_Customer.CustomerType})<>"S" in the actual database the NULL fields are the ones I'm missing. So this tells me than NULL is the same as "S" -- I don't think so, but that's h...

Excluding some columns in a SELECT statement

In the result for SELECT * from myTable WHERE some-condition; I'm interested in 9 of all the 10 columns that exist. The only way out is to specify the 9 columns explicitly ? I cannot somehow specify just the column I don't want to see? ...

LINQ SELECT FIRST ROW

Hi, How can I select first row in a linq select statement without using foreach? I use foreach and then break; but it has to be a better way? I like to get the value in first row; plus check if no row is found. My problem is to get the value without foreach statement. What I do is to find a value in my DataTable and I know the row is...

PHP - Too many mysql_query("SELECT .. ") .. ?

Hey, I'm making an e-shop and to display the tree of categories and all the products with their multiple variations of prices I made like more than 150 mysql_query("SELECT ..."); queries on one page. (If I count the "while" loops). Is it too many, and if yes, can it have any negative effect? (ofc. it takes longer to load the data ..) A...

jQuery remove options from select

I have a page with 5 select's that all have a class name 'ct'. I need to remove the option with a value of 'X' from each select while running an onclick event. My code is: $(".ct").each(function() { $(this).find('X').remove(); }); Where am I going wrong? Thanks, Chris ...

jQuery add option to select

When I attempt to add an option to a select the option I'm trying to append ends up appended to the first option instead of the select itself. $(".ct [value='']").each(function() { $(this).append($("<option></option>").attr("value", "Reset").text("Reset")); }); Help? ...