Search Results

Search found 10077 results on 404 pages for 'techie db'.

Page 17/404 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Store in DB or not to store ?

    - by eugeneK
    There are few string lists in my web application that i don't know where to store in DB or just class. ie. I have 7 major browsers with which users enter the site. I want to save these stats thus i need to create browser column in UserLogin database. I don't want to waste space and resources so i can save full browser name in each login row. So i either need to save browserID field and hook it up with Browsers table which will store names following db normalization rules or to have sort of Dataholder abstract class which has a list of browsers from which i can retrieve browser name by it's ID... The question what should i do ? These few data lists i have contain no more than 200 items each so i think it makes sense to have them as abstract class but again i don't know whether MS-SQL will handle multiple joins so well. Think of idea when i have user with country,ip,language,browser and few more stats .. thanks

    Read the article

  • Decrease DB requests number from Django templates

    - by Andrew
    I publish discount offers for my city. Offer models are passed to template ( ~15 offers per page). Every offer has lot of items(every item has FK to it's offer), thus i have to make huge number of DB request from template. {% for item in offer.1 %} {{item.descr}} {{item.start_date}} {{item.price|floatformat}} {%if not item.tax_included %}{%trans "Without taxes"%}{%endif%} <a href="{{item.offer.wwwlink}}" >{%trans "Buy now!"%}</a> </div> <div class="clear"></div> {% endfor %} So there are ~200-400 DB requests per page, that's abnormal i expect. In django code it is possible to use select_related to prepopulate needed values, how can i decrease number of requests in template?

    Read the article

  • vb.net | Update DB with OleDB

    - by liron
    i wrote a module of a connection to DB with OleDB and the 'sub UpdateClients' doesn't work, the DB don't update. what's missing or wrong? Module mdlDB Const CONNECTION_STRING As String = _ "provider= Microsoft.Jet.OleDB.4.0;Data Source=DbHalf.mdb;mode= Share Deny None" Dim daClient As New OleDb.OleDbDataAdapter Dim dsClient As New DataSet Dim cmClient As CurrencyManager Public Sub OpenClients(ByVal txtId, ByVal txtName, ByVal BindingContext) Dim Con As New OleDb.OleDbConnection(CONNECTION_STRING) Dim sqlClient As New OleDb.OleDbCommand Con.Open() sqlClient.CommandText = "SELECT*" sqlClient.CommandText += "FROM tblClubClient" sqlClient.Connection = Con daClient.SelectCommand = sqlClient dsClient.Clear() daClient.Fill(dsClient, "CLUB_CLIENT") cmClient = BindingContext(dsClient, "CLUB_CLIENT") cmClient.Position = 0 txtId.DataBindings.Add("text", dsClient, "CLUB_CLIENT.ClntId") txtName.DataBindings.Add("text", dsClient, "CLUB_CLIENT.ClntName") Con.Close() End Sub Public Sub UpdateClients(ByVal txtId, ByVal txtName, ByVal BindingContext) Dim cb As New OleDb.OleDbCommandBuilder(daClient) cmClient = BindingContext(dsClient, "CLUB_CLIENT") dsClient.Tables("CLUB_CLIENT").Rows(cmClient.Position).Item("ClntId") = txtId.Text dsClient.Tables("CLUB_CLIENT").Rows(cmClient.Position).Item("ClntName") = txtName.Text daClient.Update(dsClient, "CLUB_CLIENT") End Sub End Module

    Read the article

  • Difference between Document-oriented-DB and Bigtable clones

    - by chen
    We are looking for a suitable storage engine for our weblog history data. We looked at Bigtable's paper and understand it is suitable to us well. However, I also understand that Document-oriented-DB such as MongoDB seems to provide a little more powerful schema power -- i.e, it can model our data as well. I wonder how nowadays ppl choose a scalable NoSQL DB --- I read enough articles like "we looked at A, B and C, and we decided to use C". But I'd like to see some benchmark number. What I am saying is that if MongoDB and the like can provide same level of performance as Bigtable clones, why don't web companies choose it (preparing to deal with various potentially more complex data problem)? Thanks, By the way, I read an article (which convinced me at the moment) saying Cassandra does not fit the M/R operation, any comments?

    Read the article

  • Yii: Saving date and time in DB

    - by FaisalKhan
    I am having trouble saving the date in DB through Model. In my controller, if I dump the date in log that I receive from $_POST , I get the date in this format "10/Nov/2012 07:30". If I use: $AccountAppointment->start_date=Yii::app()->dateFormatter->format($_POST['AccountAppointment']['start_date'], 'dd/M/yyyy HH:mm'); I get the error: Invalid datetime format: 1292 Incorrect datetime value: '10/NoGMT+5/2012 07:30' for column 'start_date' Changing the format in dateFormatter to 'dd/M/yyyy HH:mm' or 'dd/MM/yyyy HH:mm' or 'dd/MMM/yyyy HH:mm' throws the same error. Db is MySQL 5.0, Yii version 1.1.12. Any help would be greatly appreciated, I am almost stuck....thanks....

    Read the article

  • Rails - how can I query the db w/o touching the sessions table

    - by sa125
    Hi - I'm trying to provide a HTTP api to my app that queries a db that's read-only (for replication purposes). I find that my app crashes repeatedly when making a request b/c the call is trying to update the sessions table whenever I query the db. This doesn't happen when I return some text without hitting the database for info. class APIController < AplicationController def view data = Product.find(params[:id]).to_json # will fail data = { :one => 1, :two => 2 }.to_json # will succeed respond_to do |format| format.html { render :json => data } end end end How do I restrict it from touching the sessions table on this request (it's currently issuing an UPDATE on the updated_at field for that session). thanks.

    Read the article

  • Convert db data encoding to UTF-8

    - by lnetanel
    Hi, I use Sql Server 2000 and I inserted some data in hebrew to a table. I need to access this data through an iPhone app using an ASP page that query the table. The problem is that in the iPhone app the Hebrew is shown as strange signs. I think my problem is that the data that is generated from my db isn't in UTF-8 but in USC-2 Any suggestions how to convert the data from my db to utf so it will be readable on the iPhone? 10x.

    Read the article

  • How does load balancing work with multiple server with multiple DBs

    - by Matt
    I guess what im looking for is a description on how this all works together. I'm used to setting up one server with maybe another server to handel the DB. My question is how does the load balancer work where do all the script(php,python) files go? If i make a change to one i have to rsync them to all the server that the balancer refers to? Also does each server need client side DB's installed so they can reference the DB's that are on other servers? If there is a site that explains all this i would be happy to read it.

    Read the article

  • Mysql: Convert DB from local time to UTC

    - by Joernsn
    I need to convert an existing (datetime fields) db from local time ut UTC. The values are stored ad datetimes on a server with time zone CET (+1) (with summertime +2). When selecting data I use UNIX_TIMESTAMP(), which magically compensates for everything, ie, time zone shift and dst (if i've read the docs right). I'm moving the db to a new server with UTC as system time. Simply subtracting -1 H won't work, as summer time is +2. Any ideas for a clever way to do this? (using sql or some script lang)

    Read the article

  • Form is trying to save the login value of the submit button to my DB.

    - by Sergio Tapia
    Here's my Zend code: <?php require_once ('Zend\Form.php'); class Sergio_Form_registrationform extends Zend_Form { public function init(){ /*********************USERNAME**********************/ $username = new Zend_Form_Element_Text('username'); $alnumValidator = new Zend_Validate_Alnum(); $username ->setRequired(true) ->setLabel('Username:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($username); /*********************EMAIL**********************/ $email = new Zend_Form_Element_Text('email'); $alnumValidator = new Zend_Validate_Alnum(); $email ->setRequired(true) ->setLabel('EMail:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($email); /*********************PASSWORD**********************/ $password = new Zend_Form_Element_Password('password'); $alnumValidator = new Zend_Validate_Alnum(); $password ->setRequired(true) ->setLabel('Password:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($password); /*********************NAME**********************/ $name = new Zend_Form_Element_Text('name'); $alnumValidator = new Zend_Validate_Alnum(); $name ->setRequired(true) ->setLabel('Name:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($name); /*********************LASTNAME**********************/ $lastname = new Zend_Form_Element_Text('lastname'); $alnumValidator = new Zend_Validate_Alnum(); $lastname ->setRequired(true) ->setLabel('Last Name:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($lastname); /*********************DATEOFBIRTH**********************/ $dateofbirth = new Zend_Form_Element_Text('dateofbirth'); $alnumValidator = new Zend_Validate_Alnum(); $dateofbirth->setRequired(true) ->setLabel('Date of Birth:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($dateofbirth); /*********************AVATAR**********************/ $avatar = new Zend_Form_Element_File('avatar'); $alnumValidator = new Zend_Validate_Alnum(); $avatar ->setRequired(true) ->setLabel('Please select a display picture:'); $this->addElement($avatar); /*********************SUBMIT**********************/ $this->addElement('submit', 'login', array('label' => 'Login')); } } ?> Here's the code I use to save the values: public function saveforminformationAction(){ $form = new Sergio_Form_registrationform(); $request = $this->getRequest(); //if($request->isPost() && $form->isValid($_POST)){ $data = $form->getValues(); $db = $this->_getParam('db'); $db->insert('user',$data); //} } When trying to save the values, I recieve a ghastly error: Column 'login' not found.

    Read the article

  • How to delete data in DB efficiently using LinQ to NHibernate (one-shot-delete)

    - by kastanf
    Hello, producing software for customers, mostly using MS SQL but some Oracle, a decision was made to plunge into Nhibernate (and C#). The task is to delete efficiently e.g. 10 000 rows from 100 000 and still stay sticked to ORM. I've tried named queries - link already, IQuery sql = s.GetNamedQuery("native-delete-car").SetString(0, "Kirsten"); sql.ExecuteUpdate(); but the best I have ever found seems to be: using (ITransaction tx = _session.BeginTransaction()) { try { string cmd = "delete from Customer where Id < GetSomeId()"; var count = _session.CreateSQLQuery(cmd).ExecuteUpdate(); ... Since it may not get into dB to get all complete rows before deleting them. My questions are: If there is a better way for this kind of delete. If there is a possibility to get the Where condition for Delete like this: Having a select statement (using LinQ to NHibernate) = which will generate appropriate SQL for DB = we get that Where condition and use it for Delete. Thanks :-)

    Read the article

  • Building an application that includes a DB, and need recommendations

    - by Rubys
    I'm going to build a little system for personal use, and I want it to save data to a database. The language is going to be C#, and so I'd like to use this opportunity to get my head around LINQ to SQL. I have some DB experience and I know my SQL, but it was all in school using Access, which is giving me trouble, and so I'd like to use another DB, something that is small in size, easy to install, and should work with LINQ to SQL. The problem is: I don't know any except Access, and am looking for recommendations. To sum it up: I need a lightweight, easy to install, linq-to-sql supporting database for a small system on a home computer, any recommendations?

    Read the article

  • A good approach to db planing for reporting service

    - by Itay Moav
    The scenario: Big system (~200 tables). 60,000 users. Complex reports that will require me to do multiple queries for each report and even those will be complex queries with inner queries all over the place + some processing in PHP. I have seen an approach, which I am not sure about: Having one centralized, de-normalized, table that registers any activity in the system which is reportable. This table will hold mostly foreign keys, so she should be fairly compact and fast. So, for example (My system is a virtual learning management system), A user enrolls to course, the table stores the user id, date, course id, organization id, activity type (enrollment). Of course I also store this data in a normalized DB, which the actual application uses. Pros I see: easy, maintainable queries and code to process data and fast retrieval. Cons: there is a danger of the de-normalized table to be out of sync with the real DB. Is this approach worth considering, or (preferably from experience) is total $#%#%t?

    Read the article

  • Loading a DB table into nested dictionaries in Python

    - by Hossein
    Hi, I have a table in MySql DB which I want to load it to a dictionary in python. the table columns is as follows: id,url,tag,tagCount tagCount is the number of times that a tag has been repeated for a certain url. So in that case I need a nested dictionary, in other words a dictionary of dictionary, to load this table. Because each url have several tags for which there are different tagCounts.the code that I used is this:( the whole table is about 22,000 records ) cursor.execute( ''' SELECT url,tag,tagCount FROM wtp ''') urlTagCount = cursor.fetchall() d = defaultdict(defaultdict) for url,tag,tagCount in urlTagCount: d[url][tag]=tagCount print d first of all I want to know if this is correct.. and if it is why it takes so much time? Is there any faster solutions? I am loading this table into memory to have fast access to get rid of the hassle of slow database operations, but with this slow speed it has become a bottleneck itself, it is even much slower than DB access. and anyone help? thanks

    Read the article

  • Looking for some Feedback on a DB Design

    - by zSysop
    I'm currently working on a ticketing system which allows our users to submit tickets based on their own needs. i.e. if Department "A" is submitting a ticket they can have certain types of problem categories (such as "Supplies" or "Printer") along with details pertaining to the chosen category. I have laid out a partial db design and i was looking for some feedback on it. I've never built a system from the ground up by myself so i'm a little bit nervous. here's my a draft version of my db design Issues Table Id | CreatedBy | CreateDate | Status | Owner | AssignedTo | AssignmentDate | ----------------------------------------------------------------------------- EquipmentIssueDetails Table Id | IssueId | Serial # | Make | Model | .... --------------------------------------------- SupplyIssueDetails Table Id | IssueId | SupplyId | ItemId | QTY | UnitOfMeasurement ------------------------------------------------------------- NetworkIssueDetails Table Id | IssueId | Supervisor | Details | ------------------------------------------------------------- Notes Table Id | IssueId | Note | CreatedBy | CreateDate ------------------------------------------------------------- Thanks in advance

    Read the article

  • thumbs.db messing up my upload routine

    - by Scott B
    I'm getting the following error while uploading a zip archive. Warning: ZipArchive::extractTo(C:\xampplite\htdocs\testsite/wp-content/themes/mytheme//styles\mytheme/Thumbs.db) [ziparchive.extractto]: failed to open stream: Permission denied in C:\xampplite\htdocs\testsite\wp-content\themes\mythem\uploader.php on line 17 The thing I can't quite figure is that I don't see a thumbs.db file in either the zip archive or the destination folder that was created (the upload still processes, I just get these errors). The function is below, line 17 is commented... function openZip($file_to_open) { global $target; $zip = new ZipArchive(); $x = $zip->open($file_to_open); if($x === true) { $zip->extractTo($target); //this is line 17 $zip->close(); unlink($file_to_open); } else { die("There was a problem. Please try again!"); } }

    Read the article

  • Pros and cons of sorting data in DB?

    - by Roman
    Let's assume I have a table with field of type VARCHAR. And I need to get data from that table sorted alphabetically by that field. What is the best way (for performance): add sort by field to the SQL-query or sort the data when it's already fetched? I'm using Java (with Hibernate), but I can't tell anything about DB engine. It could be any popular relational database (like MySQL or MS Sql Server or Oracle or HSQL DB or any other). The amount of records in table can vary greatly but let's assume there are 5k records.

    Read the article

  • Hibernate/JPA DB Schema Generation Best Practices

    - by Bytecode Ninja
    I just wanted to hear the opinion of Hibernate experts about DB schema generation best practices for Hibernate/JPA based projects. Especially: What strategy to use when the project has just started? Is it recommended to let Hibernate automatically generate the schema in this phase or is it better to create the database tables manually from earliest phases of the project? Pretending that throughout the project the schema was being generated using Hibernate, is it better to disable automatic schema generation and manually create the database schema just before the system is released into production? And after the system has been released into production, what is the best practice for maintaining the entity classes and the DB schema (e.g. adding/renaming/updating columns, renaming tables, etc.)? Thanks in advance.

    Read the article

  • SQLCe local db in temp- path in connectionstring?

    - by Petr
    Hi, I have SQL Ce db in my app, which is included in my app directory. While debugging its OK, but when published and run with setup.exe, it retrieves "file not found" in temporary directory the app is ran from. I would like to run from standard location, but I dont know how to change it. I am using this string: SqlCeConnection connection = new SqlCeConnection("Data Source=database.sdf;Persist Security Info=False;"); When I run setup.exe, the app never starts, stating that in its temporary directory the db file was not found. When I run app.exe, it works. I do not understand it...:( EDIT: I can see that in the VS project settings, there is connection string and there is "Data Source=|DataDirectory|\Database.sdf" The path should be something like local directory? Thanks!

    Read the article

  • Rails - Posting a Boolean (true or False) and updating the DB in the controller

    - by AnApprentice
    Hello, in my Rails 3 App, I'm posting with jQuery the following: http://0.0.0.0:3000/topics/read_updater?&topic_id=101&read=true In my controller: def read_updater current_user.topics.where(:topic_id => params[:topic_id]).update_all(:read => params[:read]) render :json => {:status => 'success' } end params[:conversation_id] works great, but params[:read] is inserting empty values in the DB, even though jQuery is posting either a true or false. Ideas? I want rails to update the DB with either true or false. Thanks

    Read the article

  • Export DB Tables via phpMyAdmin In Non-Alphabetical Order

    - by dosboy
    I have a MySQL database from a Joomla MultiSite installation where it has a set of tables with different prefixes for each Joomla site. When I export the db via phpMyAdmin it creates a SQL file where the tables are created and populated in alphabetical order. The problem is that the tables for the slave sites have dependencies on the tables for the master site, but alphabetically their prefixes are ahead of the master site. So the export works fine but when I try importing I get error after error and have to manually move sections around in the SQL file to make sure that the dependent tables are created/populated first. So, is it possible to export a db via phpMyAdmin with the tables in a specific order?

    Read the article

  • Creating seed model from data already in DB

    - by Nick Brown
    Is there a way to convert data in an existing database into objects that can easily be put into a seed method? Essentially I'd like to let some people add lines to my DB via a form and then convert that into an object that I can re-seed the DB anytime I need to make changes. The database itself is created via code-first using the following model: public class Combo { public int Id { get; set; } public string MainPrefix { get; set; } public string MainDescriptor { get; set; } public string MainDish { get; set; } public string Connector { get; set; } public string SecondaryDescriptor { get; set; } public string SecondaryDish { get; set; } }

    Read the article

  • retrieve value from db in php

    - by wangdoo
    I have a db in which 1 column value will be always null.I want it to pass to next page but it is passing all values of other column except this null value column. This is my code $row=mysql_query("SELECT * FROM `thirdpartycategorymaster` WHERE ISNULL(`delete`)"); while($row1=mysql_fetch_array($row)) { <td><b><a href="catdel.php?head1=<?php echo $row1['ThirdPartyCategoryName'] . '&&msg1=' . $row1['ThirdPartyCategoryID'] . '&&ctdel=' . $row1['delete']; ?> ">Delete</a></b></td> This my db table ThirdPartyCategoryID ThirdPartyCategoryName delete 29 ecommerce NULL

    Read the article

  • Array "tree" creation from db table

    - by Tural Teyyuboglu
    Trying to create array tree for db driven navigation. Getting following errur: array_key_exists() expects exactly 2 parameters, 1 given on line if (!array_key_exists($tree[$parent]['children'][$id])) Function looks like that $tree = array(); $sql = "SELECT id, parent, name FROM menu WHERE parent ... etc.... "; $results = mysql_query($sql) or die(mysql_error()); while(list($id, $parent, $name) = mysql_fetch_assoc($results)) { $tree[$id] = array('name' => $name, 'children' => array(), 'parent' => $parent); if (!array_key_exists($tree[$parent]['children'][$id])) { $tree[$parent]['children'][$id] = $id; } } Db structure How can I fix that? Whats wrong in this function?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >