select

PHP/MySQL SELECT Statement - Slight Issue

Hello all, I have recently found a hole in my SELECT statement for a private messaging system that I am developing. Here's the basic structure of my table: tblpm: unique_id thread_id subject content receiver_id sender_id date_sent The page I am developing is the inbox, where all most recent messages are displaye...

wpf: Selecting the Text in TextBox with IsReadOnly = true ?

Hi ! I have this TextBox. This TextBox is located in DataTemplate: <DataTemplate x:Key="myTemplate"> <TextBox Text="{Binding Path=FullValue, Mode=TwoWay}" IsEnabled="False" /> ... and I want to allow User to select the whole text inside it (optionally by clicking on the Textbox). And I don't want to use any code behind. ...

Django select multiple date from calendar

Hi, Im new in using Django, and i want to know if there is some way to have a multiple date selection from a calendar, i have multiple days : for example a day is : [ 28 july 2009 8:30 - 28 july 17h00 ] Is there any way to do this with Django Forms Thanks a lot kimo ...

How can I create multiple columns from one DB Field in SQL Server?

I have a field called PropertyValue in the UserProfile table that can contain information for address, phone number, first name, last name, user name, city, etc... each record in this table is associated to a user by UserId, it is also associated to a ProfilePropertyDefinition which contains the definition for each of the properties (ie....

How to select distinct values from datatable?

How to select distinct values from datatable in C#? For a retrieved data from database, I need to get its distinct value in C#? ...

Javascript Selectbox refresh necessary in YUI 3, when selecting none?

Hi all, I'm using YUI 3 to let someone click "Select All" or "Select None" and then have the selectbox select all the items or unselect all of them, respectively. Here's my code: // This selects all Y.on('click',function (e) { selectBoxNode.get("options").each(function () { this.removeAttribute('selected'...

Pull back rows from multiple tables with a sub-select?

I have a script which generates queries in the following fashion (based on user input): SELECT * FROM articles WHERE (articles.skeywords_auto ilike '%pm2%') AND spubid IN ( SELECT people.spubid FROM people WHERE (people.slast ilike 'chow') GROUP BY people.spubid) LIMIT 1; The resulting data set: Array ( [0] => Ar...

SQL statement help -- Select customers who ordered today

Say I have a table which stores customers order IDs. Such as | Customer ID | Order ID | Order Date How can I get all customers who have ordered today? Also OrderDate would be a DateTime. Something like SELECT DISTINCT CustomerID FROM TableName Where OrderDate > Today But the last part is what I can't figure out. ...

change img src using select

I'm using the select form to navigate around a page. <form name="form"> <select name="menu1" onChange="MM_jumpMenu('parent',this,1)"> <option value="#" selected>SELECT</option> <option value="#a">location A</option> <option value="#b">location B</option> </form> I'd like the select form to have the added functionality of changing...

MySQL Select Statement - For Messages

Hello all, I currently have the following tables for a private messaging forum: What I'm trying to do is output an "inbox" that displays the most recent thread at the top and group by thread (meaning, you don't see the same thread twice in your inbox), no matter who the sender is. What I have right now works fine for simple messa...

MySQL Select - Combine COUNT with GROUP_CONCAT

Hi all, I currently have a MySQL SELECT statement that pulls information from two tables to display a "Sent Messages" field for private messaging. I'd like to know how I can do add a COUNT to my query to count the number of "receivers" in one thread. Here's the basic gist of my table structure, (NOTE: the relational tie between the ...

Mysql Case returns wrong value

On one server I use mysql version 5.0.45 and when running the following query it returns 1 if boolvalue='True' AND 2.2 else, just as it should. SELECT Q.value FROM ( SELECT (CASE table.boolvalue='True' WHEN 1 THEN 1 ELSE 2.2 END) AS value FROM table ) Q; On another server (webhosting) I use mysql version 5.0.22 and when running the sa...

Linq: What is the difference between Select and Where

In linq there is the Select and Where methods. What should every developer know about these two methods (Example: when to use one over the other, any advantages over the other, etc) ...

MySQL GROUP_CONCAT Question - Probably Simple

Hello, I currently have the following query: SELECT group_concat(DISTINCT usrFirst, usrLast) as receiver_name //etc When using PHP, it outputs my list of names as follows: <?php echo $row['receiver_name']; //Outputs: JohnDoe,BillSmith,DaveJones //Desired ouput: John Doe, Bill Smith, and Dave Jones Basically, I nee...

MySQL Select Where First Character Is

How do I select the first character of a cell and use that to define what is returned? ...

MySQL - If It Starts With A Number Or Special Character

SELECT * FROM `thread` WHERE forumid NOT IN (1,2,3) AND IF( LEFT( title, 1) = '#', 1, 0) ORDER BY title ASC I have this query which will select something if it starts with a #. What I want to do is if # is given as a value it will look for numbers and special characters. Or anything that is not a normal letter. How would I do this? ...

mySQL inserting multiple records with a select

Hi, I have a "dictionary table" called car_status that has an 'id' column and a 'status' column. car_status id status 1 broken 2 fixed 3 working 4 fast 5 slow I have a table called cars with the columns: id, type, status_id cars id type status_id 1 jeep 1 2 ford 3 3 acura 4 ...

Advanced SQL SELECT

Hi, I have basic tables one and two. Let`s call them tbl1 and tbl2. tbl1 --------- 1 - apple | 2 - orange | 3 - banana | 4 - pineapple tbl2 --------- 1 - table | 2 - chair | 3 - sofa | Then there is tbl3 that has foreign keys that link it to both tables above. Table 3 form has two select fields: one that queries tbl1 and another tha...

Detect programmatical changes on a html select box.

Is there a way to make a HTML select element call a function each time its selection has been changed programmatically? Both IE and FF won't fire 'onchange' when the current selection in a select box is modified with javascript. Beside, the js function wich changes the selection is part of framework so I can't change it to trigger an on...

jQuery Select Menu Replacement

I have a select drop-down that selects a theme for the current page the user is on: <select id="style" name="acct-stylenum"> <option value="1" selected="true">Light</option> <option value="2">Dark</option> </select> Now what I would like to do is add two divs that will also control this select menu. I would...