Search Results

Search found 1874 results on 75 pages for 'jim lastname'.

Page 7/75 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Select from multiple tables, remove duplicates

    - by staze
    I have two tables in a SQLite DB, and both have the following fields: idnumber, firstname, middlename, lastname, email, login One table has all of these populated, the other doesn't have the idnumber, or middle name populated. I'd LIKE to be able to do something like: select idnumber, firstname, middlename, lastname, email, login from users1,users2 group by login; But I get an "ambiguous" error. Doing something like: select idnumber, firstname, middlename, lastname, email, login from users1 union select idnumber, firstname, middlename, lastname, email, login from users2; LOOKS like it works, but I see duplicates. my understanding is that union shouldn't allow duplicates, but maybe they're not real duplicates since the second user table doesn't have all the fields populated (e.g. "20, bob, alan, smith, [email protected], bob" is not the same as "NULL, bob, NULL, smith, [email protected], bob"). Any ideas? What am I missing? All I want to do is dedupe based on "login". Thanks!

    Read the article

  • How to convert attribute name to string?

    - by Acidburn2k
    Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname, :lastname, :email end ... some_helper_method(attrib) ... def Now I would like to pass someuser.firstname to helper and I would like to get both the value and the attribute name, for example: some_helper_method(someuser.firstname) > "firstname: Joe" some_helper_method(someuser.lastname) > "lastname: Doe"

    Read the article

  • ASP NET MVC (loading data from database)

    - by rah.deex
    hi experts, its me again... i have some code like this.. using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MvcGridSample.Models { public class CustomerService { private List<SVC> Customers { get { List<SVC> customers; if (HttpContext.Current.Session["Customers"] != null) { customers = (List<SVC>) HttpContext.Current.Session["Customers"]; } else { //Create customer data store and save in session customers = new List<SVC>(); InitCustomerData(customers); HttpContext.Current.Session["Customers"] = customers; } return customers; } } public SVC GetByID(int customerID) { return this.Customers.AsQueryable().First(customer => customer.seq_ == customerID); } public IQueryable<SVC> GetQueryable() { return this.Customers.AsQueryable(); } public void Add(SVC customer) { this.Customers.Add(customer); } public void Update(SVC customer) { } public void Delete(int customerID) { this.Customers.RemoveAll(customer => customer.seq_ == customerID); } private void InitCustomerData(List<SVC> customers) { customers.Add(new SVC { ID = 1, FirstName = "John", LastName = "Doe", Phone = "1111111111", Email = "[email protected]", OrdersPlaced = 5, DateOfLastOrder = DateTime.Parse("5/3/2007") }); customers.Add(new SVC { ID = 2, FirstName = "Jane", LastName = "Doe", Phone = "2222222222", Email = "[email protected]", OrdersPlaced = 3, DateOfLastOrder = DateTime.Parse("4/5/2008") }); customers.Add(new SVC { ID = 3, FirstName = "John", LastName = "Smith", Phone = "3333333333", Email = "[email protected]", OrdersPlaced = 25, DateOfLastOrder = DateTime.Parse("4/5/2000") }); customers.Add(new SVC { ID = 4, FirstName = "Eddie", LastName = "Murphy", Phone = "4444444444", Email = "[email protected]", OrdersPlaced = 1, DateOfLastOrder = DateTime.Parse("4/5/2003") }); customers.Add(new SVC { ID = 5, FirstName = "Ziggie", LastName = "Ziggler", Phone = null, Email = "[email protected]", OrdersPlaced = 0, DateOfLastOrder = null }); customers.Add(new SVC { ID = 6, FirstName = "Michael", LastName = "J", Phone = "666666666", Email = "[email protected]", OrdersPlaced = 5, DateOfLastOrder = DateTime.Parse("12/3/2007") }); } } } those codes is an example that i've got from the internet.. in that case, the data is created and saved in session before its shown.. the things that i want to ask is how if i want to load the data from table? i'am a newbie here.. please help :) thank b4 for advance..

    Read the article

  • Can't add object to Array in jQuery's getJSON data function (scope issue)

    - by seo20
    I have a person object and wants to store it into a global ArrayCollection I have made. Works great in normal scope: var s = new ArrayCollection(); s.add(new person("Knud", "Mikkelsen", 35)); The problem is when I want to add people inside my jQuery function "mainFunction". I can't seem to get it right. I know it's something to do with scope and I have to wrap something in functions like in my ArrayCollection. Please help me - thanks a lot. function ArrayCollection() { var myArray = new Array; return { empty: function () { myArray.splice(0, myArray.length); }, add: function (myElement) { myArray.push(myElement); }, getAll: function () { return myArray; } } } function person(firstName, lastName, age) { this.firstName = firstName; this.lastName = lastName; this.age = parseInt(parseFloat(age)); } function mainFunction() { //.... var s = new ArrayCollection(); s.add(new person("Knud", "Mikkelsen", 35)); $.getJSON(url, function (data) { for (var x = 0; x < data.length; x++) { var myPerson = new person(data[x].FirstName.toString(), data[x].LastName.toString(), data[x].Age.toString()); s.add(myPerson); } }); alert(drawArray(s.getAll())); } function drawArray(myArray) { var v = ""; for (var i = 0; i < myArray.length; i++) { v += myArray[i].firstName + " " + myArray[i].lastName + " (" + myArray[i].age + ")\n"; } return v; }

    Read the article

  • Show them the default, and allow them to press escape or Ctrl-Z

    - by cf_PhillipSenn
    I have a table cell, and when the user clicks on it, I replace the contents of the table cell with an input tag with the current contents as the default. But I don't like it's behavior because there's a chance that the user can delete the contexts on the input simply by clicking on it a second time. $('.LastName').live('click', function() { var myText = $(this).text(); $(this).empty().append('<input name="LastName" id="LastName" value="' + myText + '" />'); document.myForm.LastName.focus(); }); Q: How do I give the user a default, plus allow them to press the escape key or Ctrl-Z while in the middle of an edit?

    Read the article

  • Binding to two values

    - by developer
    Hi All, Is it possible to bind a label content to two values. For eg, I want a single label whose content is displayed as below, UserName= Firstname, Lastname where Firstname and Lastname, both are values from database. If I would be using to labels I would bind as Content={Binding Firstname} for one and Content={Binding Lastname} for another. But I want a single label to display both. Is it possible?

    Read the article

  • [Zend] phpUnit - assertQuery fails with

    - by Rosina Bignall
    I am having trouble with an assertQuery(). In the html I have (verified by outputting the body) <input type="text" name="LASTNAME" id="LASTNAME" value="" maxlength="25" size="20" /> So I wrote a query for it to test to make sure this element exists and that the value is empty $this->assertQuery('input#LASTNAME[value=""]', 1); PhpUnit says the assertion fails Failed asserting node DENOTED BY input#LASTNAME[value=""] EXISTS Can you give me some insight into why this assertion fails and how to write it properly? Thanks in advance!

    Read the article

  • How do I return pure XML from asmx web service?

    - by User
    I want an asmx webservice with a method GetPeople() that returns the following XML (NOT a SOAP response): <People> <Person> <FirstName>Sara</FirstName> <LastName>Smith</LastName> </Person> <Person> <FirstName>Bill</FirstName> <LastName>Wilson</LastName> </Person> <People/> How can I do this?

    Read the article

  • Java unit test coverage numbers do not match.

    - by Dan
    Below is a class I have written in a web application I am building using Java Google App Engine. I have written Unit Tests using TestNG and all the tests pass. I then run EclEmma in Eclipse to see the test coverage on my code. All the functions show 100% coverage but the file as a whole is showing about 27% coverage. Where is the 73% uncovered code coming from? Can anyone help me understand how EclEmma works and why I am getting the discrepancy in numbers? package com.skaxo.sports.models; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; @PersistenceCapable(identityType= IdentityType.APPLICATION) public class Account { @PrimaryKey @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String userId; @Persistent private String firstName; @Persistent private String lastName; @Persistent private String email; @Persistent private boolean termsOfService; @Persistent private boolean systemEmails; public Account() {} public Account(String firstName, String lastName, String email) { super(); this.firstName = firstName; this.lastName = lastName; this.email = email; } public Account(String userId) { super(); this.userId = userId; } public void setId(Long id) { this.id = id; } public Long getId() { return id; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public boolean acceptedTermsOfService() { return termsOfService; } public void setTermsOfService(boolean termsOfService) { this.termsOfService = termsOfService; } public boolean acceptedSystemEmails() { return systemEmails; } public void setSystemEmails(boolean systemEmails) { this.systemEmails = systemEmails; } } Below is the test code for the above class. package com.skaxo.sports.models; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertFalse; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class AccountTest { @Test public void testId() { Account a = new Account(); a.setId(1L); assertEquals((Long) 1L, a.getId(), "ID"); a.setId(3L); assertNotNull(a.getId(), "The ID is set to null."); } @Test public void testUserId() { Account a = new Account(); a.setUserId("123456ABC"); assertEquals(a.getUserId(), "123456ABC", "User ID incorrect."); a = new Account("123456ABC"); assertEquals(a.getUserId(), "123456ABC", "User ID incorrect."); } @Test public void testFirstName() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getFirstName(), "Test", "User first name not equal to 'Test'."); a.setFirstName("John"); assertEquals(a.getFirstName(), "John", "User first name not equal to 'John'."); } @Test public void testLastName() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getLastName(), "User", "User last name not equal to 'User'."); a.setLastName("Doe"); assertEquals(a.getLastName(), "Doe", "User last name not equal to 'Doe'."); } @Test public void testEmail() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getEmail(), "[email protected]", "User email not equal to '[email protected]'."); a.setEmail("[email protected]"); assertEquals(a.getEmail(), "[email protected]", "User email not equal to '[email protected]'."); } @Test public void testAcceptedTermsOfService() { Account a = new Account(); a.setTermsOfService(true); assertTrue(a.acceptedTermsOfService(), "Accepted Terms of Service not true."); a.setTermsOfService(false); assertFalse(a.acceptedTermsOfService(), "Accepted Terms of Service not false."); } @Test public void testAcceptedSystemEmails() { Account a = new Account(); a.setSystemEmails(true); assertTrue(a.acceptedSystemEmails(), "System Emails is not true."); a.setSystemEmails(false); assertFalse(a.acceptedSystemEmails(), "System Emails is not false."); } }

    Read the article

  • Setting the initial value of a property when using DataContractSerializer

    - by Eric
    If I am serializing and later deserializing a class using DataContractSerializer how can I control the initial values of properties that were not serialized? Consider the Person class below. Its data contract is set to serialize the FirstName and LastName properties but not the IsNew property. I want IsNew to initialize to TRUE whether a new Person is being instantiate as a new instance or being deserialized from a file. This is easy to do through the constructor, but as I understand it DataContractSerializer does not call the constructor as they could require parameters. [DataContract(Name="Person")] public class Person { [DataMember(Name="FirstName")] public string FirstName { get; set; } [DataMember(Name = "LastName")] public string LastName { get; set; } public bool IsNew { get; set; } public Person(string first, string last) { this.FirstName = first; this.LastName = last; this.IsNew = true; } }

    Read the article

  • Pull specific information from a long list with Perl

    - by melignus
    The file that I've got to work with here is the result of an LDAP extraction but I need to ultimately get the information formatted over to something that a spreadsheet can use. So, the data is as follows: DataDataDataDataDataDataDataDataDataDataDataDataDataDataDataData DataDataDataDataDataDataDataDataDataDataDataDataDataDataDataData displayName: John Doe name: ##userName DataDataDataDataDataDataDataDataDataDataDataDataDataDataDataData DataDataDataDataDataDataDataDataDataDataDataDataDataDataDataData displayName: Jane Doe name: ##userName DataDataDataDataDataDataDataDataDataDataDataDataDataDataDataData DataDataDataDataDataDataDataDataDataDataDataDataDataDataDataData displayName: Ted Doe name: ##userName The format that I need to export to is: firstName lastName userName firstName lastName userName firstName lastName userName Where the spaces are tabs so I can then impor that file into a database. I have experience doing this in VBScript but I'm trying to switch over to using Perl for as much server administration as possible. I'm not sure on the syntax for what I want which is basically while not endoffile{ detect "displayName: " & $firstName & " " & $lastName detect "name: ##" & $userName write $firstName tab $lastName tab $userName to file } Also if someone could point me to a resource specifically on the text parsing syntax that Perl uses, I'd be very grateful. Most of the resources that I've come across haven't been very helpful.

    Read the article

  • Nil string with [NSString stringWithFormat:] appears as "(null)"

    - by Supernico
    I have a 'Contact' class with two properties : firstName and lastName. When I want to display a contact's full name, here is what I do: NSString *fullName = [NSString stringWithFormat:@"%@ %@", contact.firstName, contact.lastName]; But when the firstName and/or lastName is set to nil, I get a "(null)" in the fullName string. To prevent it, here's what I do: NSString *first = contact.firstName; if(first == nil) first = @""; NSString *last = contact.lastName; if(last == nil) last = @""; NSString *fullName = [NSString stringWithFormat:@"%@ %@", first, last]; Does someone know a better/more concise way to do this?

    Read the article

  • Is this class + constructor definition pattern overly redundant?

    - by Protector one
    I often come across a pattern similar to this: class Person { public string firstName, lastName; public Person(string firstName, string lastName) { this.firstName = firstName; this.lastName = lastName; } } This feels overly redundant (I imagine typing "firstName" once, instead of thrice could be enough…), but I can't think of a proper alternative. Any ideas? Maybe I just don't know about a certain design pattern I should be using here? Edit - I think I need to elaborate a little. I'm not asking how to make the example code "better", but rather, "shorter". In its current state, all member names appear 3 times (declaration, initialization, constructor arguments), and it feels rather redundant. So I'm wondering if there is a pattern (or semantic sugar) to get (roughly) the same behavior, but with less bloat. I apologize for being unclear initially.

    Read the article

  • Core Data: Multiple conditions inside relational aggregate operations

    - by Uzaak
    I have an SQLite table used by Core Data with the following elements: Name: John LastName: Foobar Age: 23 Name: Bob LastName: Baz Age: 37 Name: Peter LastName: Fooqux Age: 32 Name: John LastName: Bar Age: 29 Those are all in a to-many relationship from another object "Company". I need to query the database and retrieve all Company objects with employees called "John" but whose last name does NOT contain "Foo". I did go as far as to make the following predicate: [NSPredicate predicateWithFormat:@"ANY employee.name = 'John'"]; How do I get to filter only by companies whose Johns don't have "Foo" in their last names?

    Read the article

  • Javascript IN operator compatibility

    - by jAndy
    Hi Folks, Can someone tell me since which ECMA version the IN operator is available and which browsers (versions) support it ? Explanation: The IN-operator can be used like the following: var myObject = { Firstname: 'Foo', Lastname: 'Bar' }; if('Lastname' in myObject){ // Lastname is an attribute of myObject }

    Read the article

  • Creating a custom module for Orchard

    - by Moran Monovich
    I created a custom module using this guide from Orchard documentation, but for some reason I can't see the fields in the content type when I want to create a new one. this is my model: public class CustomerPartRecord : ContentPartRecord { public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual int PhoneNumber { get; set; } public virtual string Address { get; set; } public virtual string Profession { get; set; } public virtual string ProDescription { get; set; } public virtual int Hours { get; set; } } public class CustomerPart : ContentPart<CustomerPartRecord> { [Required(ErrorMessage="you must enter your first name")] [StringLength(200)] public string FirstName { get { return Record.FirstName; } set { Record.FirstName = value; } } [Required(ErrorMessage = "you must enter your last name")] [StringLength(200)] public string LastName { get { return Record.LastName; } set { Record.LastName = value; } } [Required(ErrorMessage = "you must enter your phone number")] [DataType(DataType.PhoneNumber)] public int PhoneNumber { get { return Record.PhoneNumber; } set { Record.PhoneNumber = value; } } [StringLength(200)] public string Address { get { return Record.Address; } set { Record.Address = value; } } [Required(ErrorMessage = "you must enter your profession")] [StringLength(200)] public string Profession { get { return Record.Profession; } set { Record.Profession = value; } } [StringLength(500)] public string ProDescription { get { return Record.ProDescription; } set { Record.ProDescription = value; } } [Required(ErrorMessage = "you must enter your hours")] public int Hours { get { return Record.Hours; } set { Record.Hours = value; } } } this is the Handler: class CustomerHandler : ContentHandler { public CustomerHandler(IRepository<CustomerPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); } } the Driver: class CustomerDriver : ContentPartDriver<CustomerPart> { protected override DriverResult Display(CustomerPart part, string displayType, dynamic shapeHelper) { return ContentShape("Parts_Customer", () => shapeHelper.Parts_BankCustomer( FirstName: part.FirstName, LastName: part.LastName, PhoneNumber: part.PhoneNumber, Address: part.Address, Profession: part.Profession, ProDescription: part.ProDescription, Hours: part.Hours)); } //GET protected override DriverResult Editor(CustomerPart part, dynamic shapeHelper) { return ContentShape("Parts_Customer", () => shapeHelper.EditorTemplate( TemplateName:"Parts/Customer", Model: part, Prefix: Prefix)); } //POST protected override DriverResult Editor(CustomerPart part, IUpdateModel updater, dynamic shapeHelper) { updater.TryUpdateModel(part, Prefix, null, null); return Editor(part, shapeHelper); } the migration: public class Migrations : DataMigrationImpl { public int Create() { // Creating table CustomerPartRecord SchemaBuilder.CreateTable("CustomerPartRecord", table => table .ContentPartRecord() .Column("FirstName", DbType.String) .Column("LastName", DbType.String) .Column("PhoneNumber", DbType.Int32) .Column("Address", DbType.String) .Column("Profession", DbType.String) .Column("ProDescription", DbType.String) .Column("Hours", DbType.Int32) ); return 1; } public int UpdateFrom1() { ContentDefinitionManager.AlterPartDefinition("CustomerPart", builder => builder.Attachable()); return 2; } public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("Customer", cfg => cfg .WithPart("CommonPart") .WithPart("RoutePart") .WithPart("BodyPart") .WithPart("CustomerPart") .WithPart("CommentsPart") .WithPart("TagsPart") .WithPart("LocalizationPart") .Creatable() .Indexed()); return 3; } } Can someone please tell me if I am missing something?

    Read the article

  • Hidden Features of Google Guice

    - by Jon
    Google Guice provides some great dependency injection features. I came across the @Nullable feature recently which allows you to mark constructor arguments as optional (permitting null) since Guice does not permit these by default: e.g. public Person(String firstName, String lastName, @Nullable Phone phone) { this.firstName = checkNotNull(firstName, "firstName"); this.lastName = checkNotNull(lastName, "lastName"); this.phone = phone; } http://code.google.com/p/google-guice/wiki/UseNullable What are the other useful features of Guice (particularly the less obvious ones) that people use?

    Read the article

  • SQL Like query last match

    - by teepusink
    Hi, I've a database that has a name field. (i.e Firstname M. Lastname or just Firstname Lastname). Trying to filter by lastname. How can I do a query to find the last space? Something like select * from person where name like "% a%" (but the space is the last space) Thanks, Tee

    Read the article

  • JavaScript Load New Page Question

    - by Michael
    What I am looking to do is if a user complete a form it will provide access to a new location. <script language="JavaScript" type="text/javascript"> <!-- function validateForm(theForm) { var firstname = theForm.firstname.value; var lastname = theForm.lastname.value; var email = theForm.email.value; if (firstname == "") { alert("Please fill in your First Name."); theForm.firstname.focus(); return false; } if (lastname == "") { alert("Please fill in your Last Name."); theForm.lastname.focus(); return false; } if (email == "") { alert("Please fill in your email address."); theForm.email.focus(); return false; } return true; } I know this part is wrong but I have no idea how to go about doing it. any help would be nice.. if lastname="" if firstname="" if email="" load('www.google.com');

    Read the article

  • Passing the form scope to a Remote cfc

    - by cf_PhillipSenn
    What is the syntax for passing the form scope into a cfc with access="remote"? I have: <cfcomponent> <cfset Variables.Datasource = "xxx"> <cffunction name="Save" access="remote"> <cfset var local = {}> <!--- todo: try/catch ---> <cfif arguments.PersonID> <cfquery datasource="#Variables.Datasource#"> UPDATE Person SET FirstName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.FirstName#"> ,LastName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.LastName#"> WHERE PersonID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.PersonID#"> </cfquery> <cfset local.result = arguments.PersonID> <cfelse> <cfquery name="local.qry" datasource="#Variables.Datasource#"> INSERT INTO Person(FirstName,LastName) VALUES( <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.FirstName#"> ,<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.LastName#"> ); SELECT PersonID FROM Person WHERE PersonID=Scope_Identity() </cfquery> <cfset local.result = local.qry.PersonID> </cfif> <cfreturn local.result> </cffunction> </cfcomponent> I need to pass in form.PersonID, form.firstname, form.lastname.

    Read the article

  • Does the order of conditions in a WHERE clause affect MySQL performance?

    - by Greg
    Say that I have a long, expensive query, packed with conditions, searching a large number of rows. I also have one particular condition, like a company id, that will limit the number of rows that need to be searched considerably, narrowing it down to dozens from hundreds of thousands. Does make any difference to MySQL performance whether I do this: SELECT * FROM clients WHERE (firstname LIKE :foo OR lastname LIKE :foo OR phone LIKE :foo) AND (firstname LIKE :bar OR lastname LIKE :bar OR phone LIKE :bar) AND company = :ugh or this: SELECT * FROM clients WHERE company = :ugh AND (firstname LIKE :foo OR lastname LIKE :foo OR phone LIKE :foo) AND (firstname LIKE :bar OR lastname LIKE :bar OR phone LIKE :bar)

    Read the article

  • form not showing for empty records

    - by Chris Hodges
    I have a relatively simple PHP page called editcustomers with 3 columns. The problem I'm having is that the form will show when there is a record in the database and the fields will be populated with that info. When no such records exists, the form is not even shown, eliminating the possibility to insert a record. My page layout is as follows: Column 1 shows a form containing customer information, allowing it to be edited. Column 2 allows ordering of products and showing how many products were ordered Column 3 shows the total paid so far, and the total owing. The code for the page I have at present: <html> <?php $id = $_GET['id']; require_once('connect.php'); $sth = $dbh->query("SELECT * FROM users where id = '$id';"); $sth->setFetchMode(PDO::FETCH_ASSOC); $eth = $dbh->query("SELECT * FROM purchases where id = '$id';"); $eth->setFetchMode(PDO::FETCH_ASSOC); ?> <div id="main"> <div id="left"> <form name="custInfo" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custInfo"/> <?php while($row = $sth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="firstName" size ="30" value=" <?php echo $row["firstName"]?>"/> <p><input type = "text" name ="lastName" size ="30" value="<?php echo $row["lastName"]?>"/> <p><input type = "text" name ="country" size ="30" value="<?php echo $row["country"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="mid"> <form name="custCosts" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custCosts"/> <?php while($row = $eth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="amountOwed" size ="30" value=" <?php echo $row["amountOwed"]?>"/> <p><input type = "text" name ="numAaa" size ="30" value="<?php echo $row["numAaa"]?>"/> <p><input type = "text" name ="numBbb" size ="30" value="<?php echo $row["numBbb"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="right"> <b>Total Balance</b> <p> Money owed: </p> <p> aaa total: </p> <p> bbb total: </p> <p> Total: </p> <input type = "text" name ="pay" size ="20" /></p> <input type="submit" value="Make Payment" /> </div> <?php $dbh =null; ?> </body> </html> And the code for all the database trickery: <?php require_once 'connect.php'; $formType = $_POST['formType']; $id = $_POST['id']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $country = $_POST['country']; $amountOwed = $_POST['amountOwed ']; $numAaa = $_POST['numAaa']; $numBbb = $_POST['numBbb']; if(empty($_POST['id'])) { $sth = $dbh->prepare("INSERT INTO customers (firstName, lastName, country) VALUES ('$firstName', '$lastName', '$country')"); $sth->execute(); } elseif(!empty($_POST['id']) && !isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("UPDATE customers SET firstName = '$firstName', lastName = '$lastName', country = '$country' WHERE id = '$id'"); $sth->execute(); }elseif(!empty($_POST['id']) && isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("INSERT INTO purchases (id, amountOwed, numAaa, numBbb) VALUES ('$id', '$amountOwed', '$numAaa', '$numBbb'"); $sth->execute(); }elseif(!empty($_POST['id']) && $_POST['formType'] == 'guestCosts'){ $sth = $dbh->prepare("UPDATE purchases SET amountOwed= '$amountOwed', numAaa = '$numAaa', numBbb= '$numBbb' WHERE id = '$id'"); $sth->execute(); } $dbh =null; ?> Why does the form not even display if there is no record? An error or something I might understand....but the form is still in the HTML and should still be being output, from what I can see. Why is this not the case?

    Read the article

  • an error "has no member named"

    - by helloWorld
    I have this snippet of the code account.cpp #include "account.h" #include <iostream> #include <string> using namespace std; Account::Account(string firstName, string lastName, int id) : strFirstName(firstName), strLastName(lastName), nID(id) {} void Account::printAccount(){ cout << strFirstName; } account.h #include <string> using std::string; class Account{ private: string strLastName; //Client's last name string strFirstName; //Client's first name int nID; //Client's ID number int nLines; //Number of lines related to account double lastBill; public: Account(string firstName, string lastName, int id); void printAccount(); }; company.h #ifndef CELLULAR_COMPANY_H #define CELLULAR_COMPANY_H #include <string> #include <list> #include <iostream> #include "account.h" using namespace std; class Company { private: list<Account> listOfAccounts; public: void addAccount(string firstName, string lastName, int id) { Account newAccount(firstName, lastName, id); listOfAccounts.push_back(newAccount); } void printAccounts(){ for(list<Account>::iterator i = listOfAccounts.begin(); i != listOfAccounts.end(); ++i){ i.printAccount; //here bug } } }; #endif // CELLULAR_COMPANY_H main.cpp #include "cellularcompany.h" int main(){ Company newCompany; newCompany.addAccount("Pavel", "Nedved", 11111); newCompany.printAccounts(); return 0; } can somebody please explain what does my error mean? thanks in advance (I have it in company.h see comment there) I have bug 'struct std::_List_iterator<Account>' has no member named 'printAccount'

    Read the article

  • NHibernate find

    - by Cory
    I have a 'Customer' table with 'FirstName' and 'LastName' columns. I have to execute a search on the 'Customer' table after 'FirstName', 'LastName' and 'FirstName + LastName' depending on a TextBox text. What's the besty way/query to implement this using NHibernate or SQL query?

    Read the article

  • Amazon SimpleDB - Is there a way to list all Attributes in a Domain?

    - by beer-drinker
    Hi, I'm using C# and the AWSSDK library form Amazon to test a few things in SimpleDB. All going well so far. However, I am trying to come up with a neat way of retrieving all Attributes that are applicable to a Domain. This is proving to be tricky without having to retrieve an Item, and obviously I can get the list of attributes then. But what if I have 100,000 Items in a Domain. Let's say the first 70,000 Items in a "Person" Domain have: FirstName, LastName, Address And then I hit a Item that has FirstName, LastName, Address, Phone And then I hit another Item around the 80,000 mark which has: FirstName, LastName, Email, Phone In the above example, for the Person Domain, how would I get a list that contains: FirstName, LastName, Address, Email, Phone ...without performing a ridiculous number of select statements? Many thanks!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >