select

Find an element's sibling in a list of elements

Ok, so here's what I've got: I have a list of elements cached in a variable: elementList = $(".list-of-elements-with-this-class"); I also have a dynamically generated element from that list cached in another variable: elementList.click( function() { cachedItem = $(this); } ); What I want to do is locate cachedI...

How do I do 2 unique LEFT JOINs on the same table cell?

Hi, In mysql I'd like to do 2 unique LEFT JOINs on the same table cell. I have two tables. One table lists individual clients and has a clientNoteID and staffNoteID entry for each client. clientNoteID and staffNoteID are both integer references of a unique noteID for the note store in the notesTable. clientsTable: clientID | client...

select all li with a particual <span> and get link info within

I want choose all the li in my html that has the <span>Google Map</span> in it and apply and get the value in href with jquery. I tried going through jquey docs but coulding figure it out. Is this possible? <li><span>Google Maps Staic Link:</span> <a target="_blank" href="**Value To Get**" rel="nofollow">Map</a></li> The actual HTML...

A general single sql query.

I have a table like this: id | roll_no | name --------------------- 1 | 111 | Naveed 2 | 222 | Adil 3 | 333 | Ali If I have data like this: $fields = array( "id" , "roll_no" ) and $values = array( "1,111", "2,222" ); It means I have to write a sql query to get records from table where (id != 1 and roll_no != 111) an...

SELECT * FROM table WHERE field IN (SELECT id FROM table ORDER BY field2)

Hi there. I have 4 tables: categories - id, position subcategories - id, categories_id, position sub_subcategories - id, subcategories_id, position product - id, sub_subcategories_id, prod_pos Now I'm doing tests to find out what's wrong with my query. So i want to select sub_subcategories, and to get someting like that: [[1,2,3,4,5...

Are add() and appendChild() the same for select DOM objects?

Hello! I'm working on a small web application that changes the contents of a select drop-down. I was wondering if appendChild() and add() both accomplish the same task on a select DOM object in JavaScript? var someSelect = document.getElementById('select-list'); var newOption = document.createElement('option'); someSelect.appendChild...

Fight against INNER JOINS - Chapter: unknown column

SELECT p.id FROM produkty p, przyporzadkowania pr, stany_magazynowe, gk_grupy_produkty INNER JOIN sub_subkategorie ssi ON pr.sub_subkategorie_id = ssi.ID Tables and their important fields produkty - id, pozycja przyporzadkowania - id, produkt_id, sub_kategoria_id, sub_subkategoria_id sub_subkategorie - id, subkategorie_id, pozycja sub...

How to set order of columns where joins are included in select in Zend Framework

Hi Do you know if in case as follows there is any way to set sequence of columns? which is first, which one is second etc? $select->from(array('e' => 'equipment'), array( 'ID_equipment', 'nr_in', 'equipment_type_ID_equipment_type', 'serial_n...

How to get selected text from iframe (working on IE)

How to get selected text from iframe (working on IE) ...

How to use select() in chat client program in C socket programming ?

I'm newbie. I want to make the client program to receive input from keyboard and data from server. I don't want if while user type something (scanf) and its block to receive data from server. How to write the code in C ? Thank you. ...

sqlite select where empty?

Select in sqlite where some_colum is empty. empty counts as both NULL and "". ...

PHP SQL SELECT where like search item with multiple words

Hi, I have a select where like query for a seach form which is as follows: <?php $bucketsearch = sanitizeone($_POST["bucketsearch"], "plain"); $bucketsearch = strip_word_html($bucketsearch); ?> if(isset($_POST['search'])){ $result=MYSQL_QUERY( "SELECT * FROM buckets where bucketname like '%$bucketsearch%' order by ...

mysql select a row only if a field at another row is equal to

I have these two tables: tAccounts id, name, server_id tFriends id_lo, id_hi Now, I'm trying this query: SELECT FR.id_lo AS id_friend FROM tFriends FR, tAccounts AC WHERE (FR.id_hi = 4 && AC.server_id != -1) ........ In order get the friends of a certain user, while making sure his friend's server_id is different than '-1' ! Any i...

Style a select and options elements with multiple columns.

I'm using google translate selects as a reference. When you click to choose the languages the options shows with multiple columns. http://translate.google.com/ How can I do that ? ...

What's the equivalent of getSelected() (mootools 1.1)

In mootools 1.2, getting selected options in a multi select is easy using getSelected: // code 1 $('my_select').getSelected().each(function(opt) { // stuff }); Is there an equivalent of that in mootools 1.1 or do I have to use getChildren() and check whether it has been selected? What I have at the moment: // code 2 // get all ...

Selecting data from database based on numbers

Hey, guys, I'm trying to figure out how to select data from a MySQL table based of closeness to a number. Here's what I mean. I'm writing an application that stores the coordinates of places (longitude and latitude) what I'd like to be able to do is select data from the database based on the location of where the user is. So, say, for ...

MySQL: Optimizing SELECT from 6 huge identical tables with different data split up by timestamp

Hello, please I have the same problem as I found here http://stackoverflow.com/questions/409705/mysql-selecting-data-from-multiple-tables-all-with-same-structure-but-different , I have to select data from many MySQL tables with identical structure, but different data (split up into table_0, table_1, table_2 etc to table_5 to distribute...

Problem with the use of TOP 1 in a query

I wrote the following query to obtain a date, remove it's time part and add the time I wanted. If I run this query without the TOP clause, it works well. But when I add it, it returns the following exception: "Conversion failed when converting date and/or time from character string." Here is the query: SELECT TOP 1 CONVERT(DateTime, ...

ASP - Loop while eof or bof - Select random product from idproduct but skip empty ids

Hi, I am trying to display a random product image and description from the access database, so i am selecting the highest idproduct then randomising a number between 1 and %highestid%, this is what i have so far.... IF frontpage = 1 then SQLSTR = "SELECT idproduct AS prodtot FROM products order by idproduct desc" Set objRS = Server.C...

Can select * usage ever be justified?

I've always preached to my developers that SELECT * is evil and should be avoided like the plague. Are there any cases where it can be justified? I'm not talking about COUNT(*) - which most optimizers can figure out. Edit I'm talking about production code. And one great example I saw of this bad practice was a legacy asp application...