Search Results

Search found 2730 results on 110 pages for 'storing'.

Page 9/110 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Storing info in a PostgreSQl database issue

    - by MrEnder
    Ok I am making a registry for my website. First page asks for some personal info if($error==false) { $query = pg_query("INSERT INTO chatterlogins(firstName, lastName, gender, password, ageMonth, ageDay, ageYear, email, createDate) VALUES('$firstNameSignup', '$lastNameSignup', '$genderSignup', md5('$passwordSignup'), $monthSignup, $daySignup, $yearSignup, '$emailSignup', now());"); $query = pg_query("INSERT INTO chatterprofileinfo(email, lastLogin) VALUES('$emailSignup', now());"); $userNameSet = $emailSignup; $_SESSION['$userNameSet'] = $userNameSet; header('Location: signup_step2.php'.$rdruri); } The first query works. The second query works but doesn't save the email... the session doesn't work but the header works and sends me to the next page I get no errors even if I comment out header next page @session_start(); $conn = pg_connect("host=localhost dbname=brittains_db user=brittains password=XXXX" ); $signinCheck = false; $checkForm = ""; if(isset($_SESSION['$userName'])) { $userName = $_SESSION['$userName']; $signinCheck = true; $query = pg_query("UPDATE chatterprofileinfo SET lastLogin='now()' WHERE email='$userName'"); } if(isset($_SESSION['$userNameSet'])) { $userName = $_SESSION['$userNameSet']; $signinCheck = true; $query = pg_query("UPDATE chatterprofileinfo SET lastLogin='now()' WHERE email='$userName'"); } This is the top starting the session depending on if your logged in or not. then if I enter in the info here and put it through this if($error==false) { $query = pg_query("UPDATE chatterprofileinfo SET aboutSelf='$aboutSelf', hobbies='$hobbies', music='$music', tv='$tv', sports='$sports', lastLogin='now()' WHERE email='$userName'") or exit(pg_last_error()); //header('Location: signup_step3.php'.$rdruri); } nothing shows up for on my database from this. I have no idea where I went wrong the website is http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/

    Read the article

  • Storing objects in the array

    - by Ockonal
    Hello, I want to save boost signals objects in the map (association: signal name ? signal object). The signals signature is different, so the second type of map should be boost::any. map<string, any> mSignalAssociation; The question is how to store objects without defining type of new signal signature? typedef boost::signals2::signal<void (int KeyCode)> sigKeyPressed; mSignalAssociation.insert(make_pair("KeyPressed", sigKeyPressed())); // This is what I need: passing object without type definition mSignalAssociation["KeyPressed"] = (typename boost::signals2::signal<void (int KeyCode)>()); // One more trying which won't work. And I don't want use this sigKeyPressed mKeyPressed; mSignalAssociation["KeyPressed"] = mKeyPressed; All this tryings throw the error: /usr/include/boost/noncopyable.hpp: In copy constructor ‘boost::signals2::signal_base::signal_base(const boost::signals2::signal_base&)’: In file included from /usr/include/boost/signals2/detail/signals_common.hpp:17:0, /usr/include/boost/noncopyable.hpp:27:7: error: ‘boost::noncopyable_::noncopyable::noncopyable(const boost::noncopyable_::noncopyable&)’ is private /usr/include/boost/signals2/signal_base.hpp:22:5: error: within this context ---------- /usr/include/boost/signals2/detail/signal_template.hpp: In copy constructor ‘boost::signals2::signal1<void, int&, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>::signal1(const boost::signals2::signal1<void, int, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>&)’: In file included from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:0, /usr/include/boost/signals2/detail/signal_template.hpp:578:5: note: synthesized method ‘boost::signals2::signal_base::signal_base(const boost::signals2::signal_base&)’ first required here from /usr/include/boost/signals2.hpp:16, --------- /usr/include/boost/signals2/preprocessed_signal.hpp: In copy constructor ‘boost::signals2::signal<void(int)>::signal(const boost::signals2::signal<void(int)>&)’: In file included from /usr/include/boost/signals2/signal.hpp:36:0, /usr/include/boost/signals2/preprocessed_signal.hpp:42:5: note: synthesized method ‘boost::signals2::signal1<void, int, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>::signal1(const boost::signals2::signal1<void, int, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>&)’ first required here from /home/ockonal/Workspace/Projects/Pseudoform-2/include/Core/Systems.hpp:6,

    Read the article

  • Storing UTF8 string in a UnicodeString

    - by Mick
    In Delphi 2007 you can store a UTF8 string in a WideString and then pass that onto a Win32 function, e.g. var UnicodeStr: WideString; UTF8Str: WideString; begin UnicodeStr:='some unicode text'; UTF8Str:=UTF8Encode(UnicodeStr); Windows.SomeFunction(PWideChar(UTF8Str), ...) end; Delphi 2007 does not interfere with the contents of UTF8Str, i.e. it is left as a UTF8 encoded string stored in a WideString. But in Delphi 2010 I'm struggling to find a way to do the same thing, i.e. store a UTF8 encoded string in a WideString without it being automatically converted from UTF8. I cannot pass a pointer to UTF8 string (or RawByteString), e.g. the following will obviously not work: var UnicodeStr: WideString; UTF8Str: UTF8String; begin UnicodeStr:='some unicode text'; UTF8Str:=UTF8Encode(UnicodeStr); Windows.SomeFunction(PWideChar(UTF8Str), ...) end; Any help appreciated. Thanks.

    Read the article

  • Tapestry / JDBC - Storing Date

    - by Ben
    So Im using Tapestry and trying to store a date from a beaneditform into a simple Access database. It wont work, Im getting Null pointer exceptions and I cannot understand why. String onSuccess() { System.out.println("in on success!"); String nextPage = null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); connection = DriverManager.getConnection("jdbc:odbc:FYP_Users"); DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); Date ed = occasion.getEventDate(); String reportDate = df.format(ed); statement.executeUpdate("INSERT INTO Events (UserName, EventName, EventDate, EventTime, EventDetails, People, Rating) " + "VALUES ('" + login.getUserName() + "', '" + occasion.getEventName()+ "', '" + reportDate + "', '" + occasion.getEventTime() + "', '" + occasion.getEventDetails() + "', '" + occasion.getPeople() + "', '"+ "1" +"')"); connection.close(); occasion = new Occasion(); //occasion.setUserName(occasion.getUserName()); occasion.setEventName(occasion.getEventName()); occasion.setEventDate(occasion.getEventDate()); occasion.setEventTime(occasion.getEventTime()); occasion.setEventDetails(occasion.getEventDetails()); occasion.setPeople(occasion.getPeople()); //occasion.setRating(occasion.getRating()); nextPage = "UserIndex"; } catch (SQLException e) {e.printStackTrace();} catch (ClassNotFoundException e) {e.printStackTrace();} return nextPage; } Stack trace java.util.Calendar.setTime(Unknown Source) java.text.SimpleDateFormat.format(Unknown Source) java.text.SimpleDateFormat.format(Unknown Source) java.text.DateFormat.format(Unknown Source) myappj.pages.CreateOccasion.onSuccess(CreateOccasion.java:61) myappj.pages.CreateOccasion.dispatchComponentEvent(CreateOccasion.java) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:902) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081) org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:263) org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:398) org.apache.tapestry5.corelib.components.Form$onAction$invocation_128ef468876.invokeAdvisedMethod(Form$onAction$invocation_128ef468876.java) org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71) org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37) org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54) org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80) org.apache.tapestry5.corelib.components.Form.onAction(Form.java) org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:910) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081) org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75) org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42) $ComponentEventRequestHandler_128ef45bf4a.handle($ComponentEventRequestHandler_128ef45bf4a.java) org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) $ComponentEventRequestHandler_128ef45bf4a.handle($ComponentEventRequestHandler_128ef45bf4a.java) org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) $ComponentEventRequestHandler_128ef45bf4a.handle($ComponentEventRequestHandler_128ef45bf4a.java) $ComponentEventRequestHandler_128ef45bea5.handle($ComponentEventRequestHandler_128ef45bea5.java) org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) $ComponentRequestHandler_128ef45be99.handleComponentEvent($ComponentRequestHandler_128ef45be99.java) org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) $Dispatcher_128ef45be9b.dispatch($Dispatcher_128ef45be9b.java) $Dispatcher_128ef45be92.dispatch($Dispatcher_128ef45be92.java) org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) $RequestHandler_128ef45be93.service($RequestHandler_128ef45be93.java) org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) $RequestHandler_128ef45be93.service($RequestHandler_128ef45be93.java) org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) $RequestHandler_128ef45be93.service($RequestHandler_128ef45be93.java) org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) $RequestHandler_128ef45be93.service($RequestHandler_128ef45be93.java) myappj.services.AppModule$1.service(AppModule.java:90) $RequestFilter_128ef45be8e.service($RequestFilter_128ef45be8e.java) $RequestHandler_128ef45be93.service($RequestHandler_128ef45be93.java) org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) $RequestHandler_128ef45be93.service($RequestHandler_128ef45be93.java) $RequestHandler_128ef45be88.service($RequestHandler_128ef45be88.java) org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197) org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) $HttpServletRequestHandler_128ef45be8a.service($HttpServletRequestHandler_128ef45be8a.java) org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) $HttpServletRequestFilter_128ef45be87.service($HttpServletRequestFilter_128ef45be87.java) $HttpServletRequestHandler_128ef45be8a.service($HttpServletRequestHandler_128ef45be8a.java) org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726) $HttpServletRequestHandler_128ef45be8a.service($HttpServletRequestHandler_128ef45be8a.java) $HttpServletRequestHandler_128ef45be85.service($HttpServletRequestHandler_128ef45be85.java) org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404) org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) org.mortbay.jetty.Server.handle(Server.java:324) org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

    Read the article

  • Storing a digital signature for bookings on a web based system

    - by Duncan
    I have a web based bookings system built for a UK higher education client to allow students to sign out equipment (laptops, camera's etc). It's been in use successfully for a couple of years, in the current workflow equipment is collected and the booking is printed, signed by the student and kept until the equipment is returned. They are emailed a pdf copy of the booking and reminders if equipment is outstanding. Students can login and prebook equipment using their university LDAP credentials, the booking is then authorised by staff for later collection, but can also walk in and have equipment booked out by staff. They would like to remove the signed paper part of the process and replace this with some sort of digital signature. The suggestion was a graphics tablet but with a web based system this would require a local software package and in my view be impractical. My thought is that students would enter their LDAP username and password upon collection of the equipment, verifying their identity and effectively digitally signing the booking. My question is what would be best to store as a signature or whether to simply authenticate the user and use a boolean flag to indicate that this has been done could be deemed sufficient?

    Read the article

  • Storing data on SD Card in Android

    - by BBoom
    Using the guide at Android Developers (http://developer.android.com/guide/topics/data/data-storage.html) I've tried to store some data to the SD-Card. This is my code: // Path to write files to String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/"+ctxt.getString(R.string.package_name)+"/files/"; String fname = "mytest.txt"; // Current state of the external media String extState = Environment.getExternalStorageState(); // External media can be written onto if (extState.equals(Environment.MEDIA_MOUNTED)) { try { // Make sure the path exists boolean exists = (new File(path)).exists(); if (!exists){ new File(path).mkdirs(); } // Open output stream FileOutputStream fOut = new FileOutputStream(path + fname); fOut.write("Test".getBytes()); // Close output stream fOut.flush(); fOut.close(); } catch (IOException ioe) { ioe.printStackTrace(); } When I create the new FileOutputStream I get a FileNotFound exception. I have also noticed that "mkdirs()" does not seem to create the directory. Can anyone tell me what I'm doing wrong? I'm testing on an AVD with a 2GB sd card and "hw.sdCard: yes", the File Explorer of DDMS in Eclipse tells me that the only directory on the sdcard is "LOST.DIR".

    Read the article

  • Performance penalty of typecasting and boxing/unboxing types in C# when storing generic values

    - by kitsune
    I have a set-up similar to WPF's DependencyProperty and DependencyObject system. My properties however are generic. A BucketProperty has a static GlobalIndex (defined in BucketPropertyBase) which tracks all BucketProperties. A Bucket can have many BucketProperties of any type. A Bucket saves and gets the actual values of these BucketProperties... now my question is, how to deal with the storage of these values, and what is the penalty of using a typecasting when retrieving them? I currently use an array of BucketEntries that save the property values as simple objects. Is there any better way of saving and returning these values? Beneath is a simpliefied version: public class BucketProperty<T> : BucketPropertyBase { } public class Bucket { private BucketEntry[] _bucketEntries; public void SaveValue<T>(BucketProperty<T> property, T value) { SaveBucketEntry(property.GlobalIndex, value) } public T GetValue<T>(BucketProperty<T> property) { return (T)FindBucketEntry(property.GlobalIndex).Value; } } public class BucketEntry { private object _value; private uint _index; public BucketEntry(uint globalIndex, object value) { ... } }

    Read the article

  • iPhone NSXMLParser parsing string and storing in a NSNumber variable and different data types

    - by anubhav
    Hi, I am trying to parse a XML File using NSXMLParser, I also have a Container class, in which I have a few instance variables. One of the elements that I am trying to parse in the XML is: <book sn="32.859669048339128" pn="-116.917800670489670"> I am trying to save the value of sn and pn in an instance variable of object Container: NSNumber *sn, NSNumber *pn. I want it so that when my parser get the attributeValues it can save it as a Double (or float) in those NSNumber pointers. Right now, all it does it just saves a string to the NSNumber. The Parser Code looks like this: if([elementName isEqualToString:@"book"]){ container = [[Container alloc] init]; container.sn=[attributeDict objectForKey:@"sn"]; container.pn=[attributeDict objectForKey:@"pn"]; } I want it so that the type of container.sn is initialized to a float or double. Any ideas how to do this? Thanks in advance!

    Read the article

  • Storing Objects in columns using Hibernate JPA

    - by user210791
    Is it possible to store something like the following using only one table? Right now, what hibernate will do is create two tables, one for Families and one for people. I would like for the familymembers object to be serialized into the column in the database. @Entity(name = "family") class Family{ private final List<Person> familyMembers; } class Person{ String firstName, lastName; int age; }

    Read the article

  • Storing data to SequenceFile from Apache Pig

    - by asquithea
    Apache Pig can load data from Hadoop sequence files using the PiggyBank SequenceFileLoader: REGISTER /home/hadoop/pig/contrib/piggybank/java/piggybank.jar; DEFINE SequenceFileLoader org.apache.pig.piggybank.storage.SequenceFileLoader(); log = LOAD '/data/logs' USING SequenceFileLoader AS (...) Is there also a library out there that would allow writing to Hadoop sequence files from Pig?

    Read the article

  • Storing file permissions in Subversion repository

    - by graham.reeds
    How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository they are set to read-write. I looked on google and found a blog post from 2005 that states that Subversion doesn't store file-permissions. There are patches and hook-scripts listed (only one url still exists). Three years later does Subversion still not store file permissions and are hooks the only way to go about this? (I've never done hooks and rather use something that is native to Subversion.)

    Read the article

  • Storing and comparing biometric information

    - by Chathuranga Chandrasekara
    I am not sure whether this is the best place to post this. But this is strongly related with programming so decided to put this here. In general we use biometrics in computer applications say for authentication. Lets get 2 examples finger prints and facial recognition. In those cases how we keep the information for comparison. As an example we can't keep a image and process it every time. So what are the methodologies we use to store/determine the similarity in such cases? Are there any special algorithms that designed for that purposes.? (Ex : To return a approximately equal value for a finger print of a certain person every time)

    Read the article

  • Best pattern for storing (product) attributes in SQL Server

    - by EdH
    We are starting a new project where we need to store product and many product attributes in a database. The technology stack is MS SQL 2008 and Entity Framework 4.0 / LINQ for data access. The products (and Products Table) are pretty straightforward (a SKU, manufacturer, price, etc..). However there are also many attributes to store with each product (think industrial widgets). These may range from color to certification(s) to pipe size. Every product may have different attributes, and some may have multiples of the same attribute (Ex: Certifications). The current proposal is that we will basically have a name/value pair table with a FK back to the product ID in each row. An example of the attributes Table may look like this: ProdID AttributeName AttributeValue 123 Color Blue 123 FittingSize 1.25 123 Certification AS1111 123 Certification EE2212 123 Certification FM.3 456 Pipe 11 678 Color Red 999 Certification AE1111 ... Note: Attribute name would likely come from a lookup table or enum. So the main question here is: Is this the best pattern for doing something like this? How will the performance be? Queries will be based on a JOIN of the product and attributes table, and generally need many WHEREs to filter on specific attributes - the most common search will be to find a product based on a set of known/desired attributes. If anyone has any suggestions or a better pattern for this type of data, please let me know. Thanks! -Ed

    Read the article

  • The woes of (sometimes) storing "date only" in datetimes

    - by Heinzi
    We have two fields from and to (of type datetime), where the user can store the begin time and the end time of a business trip, e.g.: From: 2010-04-14 09:00 To: 2010-04-16 16:30 So, the duration of the trip is 2 days and 7.5 hours. Often, the exact times are not known in advance, so the user enters the dates without a time: From: 2010-04-14 To: 2010-04-16 Internally, this is stored as 2010-04-14 00:00 and 2010-04-16 00:00, since that's what most modern class libraries (e.g. .net) and databases (e.g. SQL Server) do when you store a "date only" in a datetime structure. Usually, this makes perfect sense. However, when entering 2010-04-16 as the to date, the user clearly did not mean 2010-04-16 00:00. Instead, the user meant 2010-04-16 24:00, i.e., calculating the duration of the trip should output 3 days, not 2 days. I can think of a few (more or less ugly) workarounds for this problem (add "23:59" in the UI layer of the to field if the user did not enter a time component; add a special "dates are full days" Boolean field; store "2010-04-17 00:00" in the DB but display "2010-04-16 24:00" to the user if the time component is "00:00"; ...), all having advantages and disadvantages. Since I assume that this is a fairly common problem, I was wondering: Is there a "standard" best-practice way of solving it? If there isn't, have you experienced a similar requirement, how did you solve it and what were the pros/cons of that solution?

    Read the article

  • Storing Interface type in ASP.NET Profile

    - by NathanD
    In my ASP.NET website all calls into the data layer return entities as interfaces and the website does not need to know what the concrete type is. This works fine, but I have run into a problem when trying to store one of those types into the user Profile. My interface implements ISerializable, like the following: public interface IInsured : IPerson, IEntity, ISerializable and the concrete type in the datalayer does implement ISerializable. My Profile property in web.config is: <add name="ActiveInsured" type="FacadeInterfaces.IInsured" serializeAs="Binary" defaultValue="[null]"/> It compiles just fine, but I get a runtime error on Profile.Save() saying that the interface cannot be serialized. I have also tried it with serializeAs="Xml". I thought that if my interface implemented ISerializable it would work. Anybody had this problem before or know of a workaround?

    Read the article

  • Storing VMware virtual machines in external harddisk

    - by Jeffery Ang
    Any issue with that? I recently setup ubunutu virtual machine on my external harddisk. Once i accidentally removed the external harddisk usb connection then when i try to startup the ubuntu virtual machine again i get kernel panic. I thinking of writing a cron script to backup everyday to another location to prevent this issue

    Read the article

  • Storing Preferences/One-to-One Relationships in Database

    - by LnDCobra
    What is the best way to store settings for certain objects in my database? Method one: Using a single table Table: Company {CompanyID, CompanyName, AutoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter} Method two: Using two tables Table Company {CompanyID, COmpanyName} Table2 CompanySettings{CompanyID, utoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter}

    Read the article

  • Doctrine unsigned validation error storing created_at

    - by Alex Dean
    Hi, I'm having problems with the Timestampable functionality in Doctrine 1.2.2. The error I get on trying to save() my Record is: Uncaught exception 'Doctrine_Validator_Exception' with message 'Validation failed in class XXX 1 field had validation error: * 1 validator failed on created_at (unsigned) ' in ... I've created the relevant field in the MySQL table as: created_at DATETIME NOT NULL, Then in setTableDefinition() I have: $this->hasColumn('created_at', 'timestamp', null, array( 'type' => 'timestamp', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, )); Which is taken straight from the output of generateModelsFromDb(). And finally my setUp() looks like: public function setUp() { parent::setUp(); $this->actAs('Timestampable', array( 'created' => array( 'name' => 'created_at', 'type' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'disabled' => false, 'options' => array() ), 'updated' => array( 'disabled' => true ))); } (I've tried not defining all of those fields for 'created', but I get the same problem.) I'm a bit stumped as to what I'm doing wrong - for one thing I can't see why Doctrine would be running any unsigned checks against a 'timestamp' datatype... Any help gratefully received! Alex

    Read the article

  • Storing a set of criteria in another table

    - by bendataclear
    I have a large table with sales data, useful data below: RowID Date Customer Salesperson Product_Type Manufacturer Quantity Value 1 01-06-2004 James Ian Taps Tap Ltd 200 £850 2 02-06-2004 Apple Fran Hats Hats Inc 30 £350 3 04-06-2004 James Lawrence Pencils ABC Ltd 2000 £980 ... Many rows later... ... 185352 03-09-2012 Apple Ian Washers Tap Ltd 600 £80 I need to calculate a large set of targets from table containing values different types, target table is under my control and so far is like: TargetID Year Month Salesperson Target_Type Quantity 1 2012 7 Ian 1 6000 2 2012 8 James 2 2000 3 2012 9 Ian 2 6500 At present I am working out target types using a view of the first table which has a lot of extra columns: SELECT YEAR(Date) , MONTH(Date) , Salesperson , Quantity , CASE WHEN Manufacturer IN ('Tap Ltd','Hats Inc') AND Product_Type = 'Hats' THEN True ELSE False END AS IsType1 , CASE WHEN Manufacturer = 'Hats Inc' AND Product_Type IN ('Hats','Coats') THEN True ELSE False END AS IsType2 ... ... , CASE WHEN Manufacturer IN ('Tap Ltd','Hats Inc') AND Product_Type = 'Hats' THEN True ELSE False END AS IsType24 , CASE WHEN Manufacturer IN ('Tap Ltd','Hats Inc') AND Product_Type = 'Hats' THEN True ELSE False END AS IsType25 FROM SalesTable WHERE [some stuff here] This is horrible to read/debug and I hate it!! I've tried a few different ways of simplifying this but have been unable to get it to work. The closest I have come is to have a third table holding the definition of the types with the values for each field and the type number, this can be joined to the tables to give me the full values but I can't work out a way to cope with multiple values for each field. Finally the question: Is there a standard way this can be done or an easier/neater method other than one column for each type of target? I know this is a complex problem so if anything is unclear please let me know. Edit - What I need to get: At the very end of the process I need to have targets displayed with actual sales: Type Year Month Salesperson TargetQty ActualQty 2 2012 8 James 2000 2809 2 2012 9 Ian 6500 6251 Each row of the sales table could potentially satisfy 8 of the types. Some more points: I have 5 different columns that need to be defined against the targets (or set to NULL to include any value) I have between 30 and 40 different types that need to be defined, several of the columns could contain as many as 10 different values For point 2, if I am using a row for each permutation of values, 2 columns with 10 values each would give me 100 rows for each sales person for each month which is a lot but if this is the only way to define multiple values I will have to do this. Sorry if this makes no sense!

    Read the article

  • Why mysql is not storing data after "#" character?

    - by Nitz
    Hey Friends, I have made one form in which there is rich text editor. and i m trying to store the data to database. now i have mainly two problem.. 1) As soon as the string which contents "#"(basically when i try to change the color of the font)     character, then it does not store characters after "#". and it also not store "#" character also. 2) although i had tried....in javascript html.replace("\"","'"); but it does not replace the double quotes to single quotes.

    Read the article

  • Storing extended IIdentity in HttpContext.Current.User (IPrinciple)

    - by UpTheCreek
    I have created an ExtendedId class which extends GenericIdentity. (This stores Id as well as name) In a httpmodule I stored this extended id in Current.User like so: HttpContext.Current.User = new GenericPrincipal(myExtendedId, roles); Problem is, later, how do I get at my ExtendedId type again? If I try this: ExtendedId eId = (ExtendedId)HttpContext.Current.User.Identity; I get a casting error. I have a feeling I'm doing something stupid here with casting, but I'm a bit foggy this morning.

    Read the article

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