Search Results

Search found 15878 results on 636 pages for 'hidden field'.

Page 75/636 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • globally get any field value in user table of logged in user

    - by Jugga
    Im making a gaming community and i wanna be able to grab any info of the user on any page without so instead of having much of queries on all pages i made this function. Is it better to do this? Will this slow down the site? /** * ??????? ???????? ?? ????? ??????? authed ?????????????. */ function UserData($f) { global $_SESSION; return mysql_result(mysql_query("SELECT `$f` FROM `users` WHERE `id` = ".intval($_SESSION['id'])), 0, $f); }

    Read the article

  • How do I display different values based on the date field in MS Word 97?

    - by vans
    I want to display some text based on the date field. I have the field called "future date" in the MS word (I have created this field using "{MERGEFIELD FUTURE DATE}). If the 'future date' is less than 2 months from the current system date, the following statement should be produced: "ABCDEFG" If the 'future date' is 2 months or more from the current system date, the following statement should be produced: "Zyxuvw" Can any one help on this?

    Read the article

  • Re-use aliased field in SQL SELECT STATEMENT

    - by Bad Display Name
    Hi, the question is hard to define without giving an example, e.g. I'd like to achieve something like this : SELECT (CASE WHEN ...) AS FieldA, 20 + FieldA AS FieldB FROM Tbl Assuming that by "..." I've replaced a long and complex CASE statement, hence I don't want to repeat it when selecting FieldB and use the aliased FieldA instead. IS THIS EVEN POSSIBLE? What could be a workaround? Note, that this will return multiple rows , hence the DECLARE/SET outside the SELECT statement is no good in my case. PLEASE HELP. P.S. I am using SQL 2008

    Read the article

  • select row from table and substitute a field with one from another column if not null

    - by EarthMind
    I'm trying construct a PostgreSQL query that does the following but so far my efforts have been in vain. Problem: There are two tables: A and B. I'd like to select all columns from table A (having columns: id, name, description) and substitute the "A.name" column with the value of the column "B.title" from table B (having columns: id, table_A_id title, langcode) where B.table_A_id is 5 and B.langcode is "nl" (if there are any rows). I've tried using a CASE and COALESCE() but failed due to my inexperience with both concepts. Thanks in advance.

    Read the article

  • calculating change (over a period) for a dated field

    - by morpheous
    I have two tables with the following schema: CREATE TABLE sales_data ( sales_time date NOT NULL, product_id integer NOT NULL, sales_amt double NOT NULL ); CREATE TABLE date_dimension ( id integer NOT NULL, datestamp date NOT NULL, day_part integer NOT NULL, week_part integer NOT NULL, month_part integer NOT NULL, qtr_part integer NOT NULL, year_part integer NOT NULL, ); I want to write two types of queries that will allow me to calculate: period on period change (e.g. week on week change) change in period on period change (e.g. change in week on week change) I would prefer to write this in ANSI SQL, since I dont want to be tied to any particular db. [Edit] In light of some of the comments, if I have to be tied to a single database (in terms of SQL dialect), it will have to be PostgreSQL The queries I want to write are of the form (pseudo SQL of course): Query Type 1 (Period on Period Change) ======================================= a). select product_id, ((sd2.sales_amt - sd1.sales_amt)/sd1.sales_amt) as week_on_week_change from sales_data sd1, sales_data sd2, date_dimension dd where {SOME CRITERIA) b). select product_id, ((sd2.sales_amt - sd1.sales_amt)/sd1.sales_amt) as month_on_month_change from sales_data sd1, sales_data sd2, date_dimension dd where {SOME CRITERIA) Query Type 2 (Change in Period on Period Change) ================================================= a). select product_id, ((a2.week_on_week_change - a1.week_on_week_change)/a1.week_on_week_change) as change_on_week_on_week_change from (select product_id, ((sd2.sales_amt - sd1.sales_amt)/sd1.sales_amt) as week_on_week_change from sales_data sd1, sales_data sd2, date_dimension dd where {SOME CRITERIA) as a1), (select product_id, ((sd2.sales_amt - sd1.sales_amt)/sd1.sales_amt) as week_on_week_change from sales_data sd1, sales_data sd2, date_dimension dd where {SOME CRITERIA) as a2) WHERE {SOME OTHER CRITERIA}

    Read the article

  • Replace first Letter in a field Oracle

    - by Stanley
    Hi Guys I have this Table I need to replace the First Letter in ACCT_NAME with the First Name of ACCT_SHORT_NAME. Records like the Higliighted(RAFFMAN) should not be changed. I have tried: select acct_name, ACCT_SHORT_NAME,replace(acct_name, substr(acct_name, 1, 1), ACCT_SHORT_NAME) from tbaadm.gam where schm_type = 'TDA' and rcre_user_id = 'SYSTEM' and substr(acct_name,2,1) = ' ' I am getting: This means that am Picking the whole value in ACCT_SHORT_NAME. WHat is the best way to do what am trying to do?

    Read the article

  • How can I get document field with jqCouch?

    - by Angelo
    Has anyone ever used jqCouch - jquery plugin for CouchDB? Know how to retrieve the fields in a document? with futon i created a document ex: _id "ceb5da7e0ac10c619e81b2a9c2ab115e" _rev "2-9ae589297cf186b6899f5762a40324e5" post "great" I try this for example: var dc = $.jqCouch.connection('doc'); var all = dc.all('testapp'); var all_documents = null; if (all.total_rows > 0) { all_documents = all.rows; } var c = all_documents[0].value.post; into value I have only _id and _rev, but not post. thanks!

    Read the article

  • Magento: Add (and retrieve) custom database field for CMS pages

    - by Toby H
    I want to assign custom parameters to CMS pages in Magento (i.e. 'about', 'customer service', etc), so they can be grouped. The end goal is to use the parameters for each page to show (or hide) them in a nav menu. Writing a quick method in the page/html block to retrieve the pages (active only) for the menu was easy, but I can't figure out how to group them so that 'testimonials', 'history', and 'contact' are associated with 'about', and 'return policy', 'shipping', and 'contact' are associated with 'customer service'. Any help to point me in the right direction would be greatly appreciated. Thanks!

    Read the article

  • One Database Field to Hold Survey Answer

    - by yar
    Skipping the question of whether this is bad design (and the question of why I would want/need to do this), I'm just wondering if my 'math' is right... I have n things that need to be put in order (n is always less than 5): thing1 thing2 thing3 ... and I'd like to store these results in a single integer for thing. My initial thought is that (obviously the code will not look like this): thing = thing1 * 1 + thing2 * 2 + thing3 * 4 + thing5 * 8 will always give me a unique value, and that any value for thing will always translate back to its values for thing1...thingn. Is this correct?

    Read the article

  • SQL Select between two fields depending on the value of one field

    - by Filip
    Hi. I am using a PostgreSQL database, and in a table representing some measurements I've two columns: measurement, and interpolated. In the first I've the observation (measurement), and b is the interpolated value depending on nearby values. Every record with an original value has also an interpolated value. However, there are a lot of records without "original" observations (NULL), hence the values are interpolated and stored in the second column. So basically there are just two cases in the database: Value Value NULL Value Of course, it is preferable to use the value from the first column if available, hence I need to build a query to select the data from the first column, and if not available (NULL), then the database returns the value from the second column for the record in question. I have no idea how to build the SQL query. Please help. Thanks.

    Read the article

  • Recordset Update errors when updating sql_variant field

    - by Stephen Nutt
    I'm using C++ and ADO to add data to a SQL Server 2005 database. When calling the Recordset Update method for a sql_variant column I'm getting the error DB_E_ERRORSOCCURRED and the error message Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. If the value I'm adding is NULL all works fine and all values going to the fields that are not sql_variant types work. Does anyone know what I might be doing wrong? Thanks [Edit] I have some more information. The value we are storing is the empty string - ADO appears to want to store this in the sql_variant as a nchar(0), which of course is not a valid SQL data type. Is there a way to get an empty string in a sql_variant using the ADO batch commands?

    Read the article

  • Struts field is prepopulated with the recent value

    - by Sukhhhh
    We had an application that uses struts. We are using struts .. html:text for a text box and value of this is prepopulated with a recent value (not with the initialized value) even when the member is logged in after logging out. The worst part is other members also able to see the value entered in the textbox by the recent member logged in. How do you stop this happening?

    Read the article

  • PHP-How to Pass Multiple Value In Form Field

    - by Tall boY
    hi i have a php based sorting method with drop down menu to sort no of rows, it is working fine. i have another sorting links to sort id & title, it is also working fine. but together they are not working fine. what happens is that when i sort(say by title) using links, result gets sorted by title, then if i sort rows using drop down menu rows get sorted but result gets back to default of id sort. sorting codes for id & tite is if ($orderby == 'title' && $sortby == 'asc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=title&sort=asc'>title-asc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=title&sort=asc'>title-asc:</a></li> ";} if ($orderby == 'title' && $sortby == 'desc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=title&sort=desc'>title-desc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=title&sort=desc'>title-desc:</a></li> ";} if ($orderby == 'id' && $sortby == 'asc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=id&sort=asc'>id-asc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=id&sort=asc'>id-asc:</a></li> ";} if ($orderby == 'id' && $sortby == 'desc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=id&sort=desc'>id-desc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=id&sort=desc'>id-desc:</a></li> ";} ?> sorting codes for rows is <form action="is-test.php" method="get"> <select name="rpp" onchange="this.form.submit()"> <option value="10" <?php if ($rowsperpage == 10) echo 'selected="selected"' ?>>10</option> <option value="20" <?php if ($rowsperpage == 20) echo 'selected="selected"' ?>>20</option> <option value="30" <?php if ($rowsperpage == 30) echo 'selected="selected"' ?>>30</option> </select> </form> this method passes only rows per page(rpp) into url. i want it to pass order, sort& rpp. is there a way around to pass multiple values in form fields like this. <form action="is-test.php" method="get"> <select name="rpp, order, sort" onchange="this.form.submit()"> <option value="10, $orderby, $sortby" <?php if ($rowsperpage == 10) echo 'selected="selected"' ?>>10</option> <option value="20, $orderby, $sortby" <?php if ($rowsperpage == 20) echo 'selected="selected"' ?>>20</option> <option value="30, $orderby, $sortby" <?php if ($rowsperpage == 30) echo 'selected="selected"' ?>>30</option> </select> </form> this may seem silly but it just to give you an idea of what i am trying to implement,(i am very new to php) please suggest any way to make this work. thanks

    Read the article

  • Mobile Safari text selection after input field focus

    - by Andy
    I have some legacy html that needs to work on old and new browsers (down to IE7) as well as the iPad. The iPad is the biggest issues because of how text selection is handled. On a page there is a textarea as well as some text instructions. The instructions are in a <div> and the user needs to be able to select the instructions. The problem is that once focus is placed in the textarea, the user cannot subsequently select the text instructions in the <div>. This is because the text cannot receive focus. According to the Safari Web Content Guide: Handling Events (especially, "Making Elements Clickable"), you can add a onclick event handler to the div you want to receive focus. This solution works (although it is not ideal) in iOS 6x but it does not work in iOS 5x. Does anyone have a suggestion that minimizes changes to our existing code and produces consistant user interaction. Here is sample code that shows the problem. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script src="http://code.jquery.com/jquery-1.8.2.js"></script> <!-- Resources: Safari Web Content Guide: Handling Events (especially, "Making Elements Clickable") http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW1 --> </head> <body> <div style="width:550"> <div onclick='function() { void(0); }'> <p>On the iPad, I want to be able to select this text after the textarea has had focus.</p> </div> <textarea rows="20" cols="80">After focus is in the textarea, can you select the text above?</textarea> </div> </body> </html>

    Read the article

  • Comma separated values in a database field

    - by John Doe
    I have a products table. Each row in that table corresponds to a single product and it's identified by a unique Id. Now each product can have multiple "codes" associated with that product. For example: Id | Code ---------------------- 0001 | IN,ON,ME,OH 0002 | ON,VI,AC,ZO 0003 | QA,PS,OO,ME What I'm trying to do is create a stored procedure so that I can pass in a codes like "ON,ME" and have it return every product that contains the "ON" or "ME" code. Since the codes are comma separated, I don't know how I can split those and search them. Is this possible using only TSQL? Edit: It's a mission critical table. I don't have the authority to change it.

    Read the article

  • UPDATE Table SET Field

    - by davlyo
    This is my Very first Post! Bear with me. I have an Update Statement that I am trying to understand how SQL Server handles it. UPDATE a SET a.vField3 = b.vField3 FROM tableName a INNER JOIN tableName b ON a.vField1 = b.vField1 AND b.nField2 = a.nField2 – 1 This is my query in its simplest form. vField1 is a Varchar nField2 is an int (autonumber) vField3 is a Varchar I have left the WHERE clause out so understand there is logic that otherwise makes this a nessessity. Say vField1 is a Customer Number and that Customer has 3 records The value in nField2 is 1, 2, and 3 consecutively. vField3 is a Status When the Update comes to a.nField2 = 1 there is no a.nField2 -1 so it continues When the Update comes to a.nField2 = 2, b.nField2 = 1 When the Update comes to a.nField2 = 3, b.nField2 = 2 So when the Update is on a.nField2 = 2, alias b reflects what is on the line prior (b.nField2 = 1) And it SETs the Varchar Value of a.vField3 = b.vField3 When the Update is on a.nField2 = 3, alias b reflects what is on the line prior (b.nField2 = 2) And it (should) SET the Varchar Value of a.vField3 = b.vField3 When the process is complete –the Second of three records looks as expected –hence the value in vField3 of the second record reflects the value in vField3 from the First record However, vField3 of the Third record does not reflect the value in vField3 from the Second record. I think this demonstrates that SQL Server may be producing a transaction of some sort and then an update. Question: How can I get the DB to Update after each transaction so I can reference the values generated by each transaction?

    Read the article

  • Finding object count where a field is unique in Django

    - by Johnd
    I have a model that is something like this: class Input(models.Model): details = models.CharField(max_length=1000) user = models.ForeignKey(User) class Case(Input): title = models.CharField(max_length=200) views = models.IntegerField() class Argument(Input): case = models.ForeignKey(Case) side = models.BooleanField() A user can submit many arguments, per case. I want to be able to say how many users have submitted side=true arguments. I mean if 1 user had 10 arguments and another user had 2 arguments (both side=true) I'd want the count to be 2, not 12.

    Read the article

  • Problem using Min(field)

    - by Todd
    have these two queries: SELECT classroomid AS crid, startdate AS msd FROM unitTemplates where classroomid = 6 GROUP BY classroomid and: SELECT classroomid AS crid, Min(startdate) AS msd FROM unitTemplates where classroomid = 6 GROUP BY classroomid The second query uses the minimum function. There is only one record in my table with a classroomid of 6. The first query returns msd = 20100505, the second query returns msd = 0 (instead of the expected 20100505). If I change the "Min" to "Max" it returns the highest (and only) startdate (20100505). Why doesn't MySQL like the Min function I'm using?

    Read the article

  • Pre-Populated Date in Text Field

    - by user2537332
    I am trying to pre-populate a text box with today's date, but for some reason, it keeps showing today's date as 5/30/13, which is a month behind. This code should just be pulling the local time so why is it a month behind? Here is my code, can someone please tell me why the current date is off...Please help, :) var dateToday=new Date(); function loadDate(){ var today=dateToday.getMonth() + "/" +dateToday.getDate()+"/"+dateToday.getFullYear(); document.forms[0].curDate.value=today; } function orderReady(orderTime){ dateToday.setDate(dateToday.getDate()+orderTime); var ready=dateToday.getMonth()+"/" +dateToday.getDate()+"/"+dateToday.getFullYear(); document.forms[0].puDate.value=ready; } <body onload="loadDate();"> <p>Today's Date<br /> <input type="text" name="curDate" size="50" /><br />

    Read the article

  • Find record whose field 'name' not contained within any other record

    - by charlie
    I have a model Foo with a String bar and a String name. Some records' bar contain the name of other records in them. This is intentional. I want to find the "root Foo" records - that is, the ones where their name do not appear in the bar records of any other Foo records. Example: Foo id: 1 name: 'foo1' bar: 'something something' id: 2 name: 'foo2' bar: 'foo1 something' id: 3 name: 'foo3' bar: 'foo1, foo4' My method root_foos would return foo2 and foo3 since their names do not appear in any bar string. edit: I don't want to use a relation or foreign key here - just this method.

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >