database

Import and Append Android Database from SD Card

I have 2 apps, a free version and a paid version. Each version allows the user to backup their database data to the SD card. The databases being saved are exactly the same (i.e. they have the same columns defined). If the user wants to import the data from the free version to the paid version, I can do this easily if the user hasn't sav...

Display line break in <div> tag from database

I have to display an article from database inside a < div> tag. This article was inserted into database from a textarea. My problem is: i could not display exactly the structure that i inserted from the textarea (including line break) I tried the below code to replace the enter character to < br> tag but it did not work <div id="tmpId"...

Field naming question

How should the naming go for colunms used systemwide. For example city. In city lookup table the colunm is called city_id, city_name. Now city is used in other places like events - I have called it event_city which refers back to city_name. Then in user profile there is user_city which again does the same. Should these all be called the ...

Keyword based Chatterbot in a Web Application

I'm trying to create a keyword based Chatterbot on the web. Simply look for keywords in an input and return relevant responses. Example: User(Input): What is your phone number? Bot(Output): 555-555-5555 This would occur due to the presence of the the keyword "phone" or "number". You could create a database of keywords: Output Strin...

upload videos from youtube

I'm going to store the video embed code from youtube since users can upload videos. What should be the data type of the field where I would store the video embed code. Video embed code like this: <object width="640" height="385"> <param name="movie" value="http://www.youtube.com/v/M8uPvX2te0I?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&g...

Why would you ever want to store a plain-text or encrypted(not hashed) password in a database?

I've heard quite a few reasons for storing hashed passwords in a database. However, there are almost always options in authentications APIs to store passwords as plain text or encrypted. Is there ever a reason you would want to store a password as plain text or encrypted in a database? Note To be clear I know that storing non-hashed ...

Basic table structure question

I have Brand and Company. 1 Company can have 1 or more Brands. As an example, company has company_id, company_name. Similarly Brands has brand_id and brand_name. Now can i add the FK column company_id to brands also and the relationship is complete in 2 tables or do i need a 3rd table like Company_Brands which will have company_id, bran...

Provisioning database schemas in ruby

I'm looking for a database agnostic way to create new schemas. Something like postgres_uri = "postgres://username:password@hostname/database" mysql_uri = "mysql://username:password@hostname/database" [postgres_uri, mysql_uri].each do |db| connection = DB.connect(db_uri) connection.create_schema("xyz") end Bonus marks for somethin...

How to duplicate a table with all its constrains in SQL*Plus?

Using create table tab2 as select * from tab1;, I am able to copy the data but not the primary key constraint : SQL> desc tab1; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER NAME ...

Is Zpsycopg2 compatible with zope 2??

I have zope 2.11 installed. Now i want to use Posgresql 7.4.13 DB with it. So i know i need to install psycopg2 Database Adapter. Can any one tell me Is psycopg2 compatible with zope2?? ...

Deadlock issue in SQL Server 2008 R2 (.Net 2.0 Application)

The Sql Server 2008 R2 instance in question is a heavy load OLTP production server. The deadlock issue came up a few days back and is still unresolved. We received the Xml deadlock report that listed the stored procedures involved in the deadlock and some other details. I'll try to list down the facts from this xml first: Two stored pro...

jQuery, DB Update/Display Problem

Hi, I implemented a thumpsup function in php. the view holds a thumpsup button and everytime the user clicks on it the db is updated. I am working with zend framework, so I have a url mypage.de/articles/thumpsup/id/x this url points to a specific acion/function in my articles conroller, but this function does not return any data, it jus...

is there a boolean type in oracle databases?

is there a boolean type in oracle databases? ...

Using a single DataSource on Multiple .NET Forms

My program has two forms which get data from the same data source. After binding controls to tables and fields on both forms, I noticed each form has it's own apparently duplicate DataSet. Is it standard practice for each form to have its own DataSet even though they use the same ConnectionString and connect to the same database at the...

mysqldump all tables with data, with create and add-drop tables statements (Urgent help)

Hi all, I need to take back up of mysql database,but condition is that back up file should contains only tables that contains data, and there should be an create and drop statements too. Please me out. its very urgent. I checkd mysqldupm manual pages. did nt get options. Thanks kumar kasimala. ...

How can I delete all the databases in my machine without deleting them one by one?

I want to delete all the databases in my Macbook pro. The number is more than 300 so I can't remove them one by one. How can I delete all the databases without deleting them one by one? ...

iPhone web-app: HTML5 database and audio files

I'm having issues with audio files on the iPhone web-app. Seems as each time an audio file is played, it's loaded first then played, even if repeating the same audio on a page that hasn't refreshed (done via javascript). From what I've research manifest files would be great but they are for offline application. I'm now researching HTML5 ...

php curl, xml content character problem.

Hello I just start to develop php what I want to do is to get xml contents from another site but when i get it like this $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_ENCODING => "UTF-8", // handle compressed CURLOPT_USERAGE...

Database Design: ordered many-to-many relationship

In Django, I have the following models: class Pink(models.Model): ... class White(models.Model): ... pinks = models.ManyToManyField(Pink) ... At some point, I needed to define an ordering of Pinks inside a White (in order to have White1.pinks: P1, P2, P3 instead of a random White1.pinks: P2, P3, P1), so I've created ...

The best way to interact with a database, with objects

Alright, so after years of feeling that I've been doing it the wrong way, what is the best way to interact with a MySQL database, using PHP. Going to start off small-scale, but eventually hoping to grow large scale. I'd love to be able to use objects, like such $book = new Book(1342); echo $book->title; So, what is the best way to go...