database

Is it safe to place password on same folder?

I am using php and mysql. I have a Database config file (db-config.php) which has my database name, username and password. My application and db config file store at: www(httpdocs)/app/db-config.php Is that secure? Will others/hackers able to steal my file and get my database login information? Or should i put it outside www folder, fo...

Why is DB an acronym and not abbreviation?

According to the .NET framework design guidelines, they say DB is an acronym and cased as such. But I thought it was an abbreviation of database? ...

How transport data between different database encoding?

We have such a oracle database which contains "Tranditional Chinese" character and english, and the environment is : PARAMETER VALUE NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET WE8PC850 NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR ...

How do I put data into the datastore of Google's app engine?

I have a little application written in php+mysql I want to port to AppEngine, but I just can't find the way to port my mysql data to the datastore. How am I supposed to save the data into my datastore? Is that even possible? I can only see documentation for persistence of Java objects, does that mean I have to port my database to a bunc...

How to model and query inheritance in a hierarchy of rows in a database table?

I have a set of records, stored as XML files, where the XML files are arranged in a tree structure. For each child record, elements or attributes which are not explicitly stated are assumed to be inherited from the parent record. This is easy to model in a database, with a self-referential foreign key, e.g. Tree Structure Foo / ...

Rails: store translations in database

Hello, I was searching for a plugin/gem solution to extend the native rails i18n for storing my translations into my database. Maybe I used the wrong search terms, but all I found was the information, that changing the backend IS actually possible and this blog entry which descripes how to write my own backend. It's hard to imagine, th...

What should I do to refresh data with concurrent sqlite 3 access

I have two sqlite windows clients concurrently using a sqlite 3 base on the network. When one appends data the record is successfully appended (there's no the journal file at the moment). But another client doesn't see this record even when a fresh SELECT query is fired and starts to see this record of this table after some SELECT querie...

DB2 Increment a value by a certain amount

I need to write a query that increments a value in a table by 3 when run. I would like to do something like this but this doesn't work. UPDATE table SET value = (SELECT value FROM table WHERE condition = true) + 3 WHERE condition = true As in the title this is a DB2 database, any ideas? EDIT: Actually this d...

Saving images: files or blobs?

When you save your images (supose you have lots of them) do you store then as blobs in your Database, or as files? Why? Duplicate of: http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay ...

How to do join with SUM in ActiveRecord

Let's say I have two simple models project t.string :title vote t.references :project t.integer :value When I do loop throuh all projects, I also want to include sum of all votes, because doing projects = Project.all foreach project in projects sum = project.votes.sum(:value) ... isn't really effective. Is there...

PDO and nested fetching

Let's say I have something like this: $db=new PDO($dsn); $statement=$db->query('Select * from foo'); while ($result=$statement->fetch()) { //do something with $result } How would I put another query inside of that while loop? Even if I make a new PDOStatement object, it seems that that overwrites the cursor for the topmost PDO s...

importing mysql file into access DB

i need to import a mysql file into my access db. how do i do this? here's a sample of the mysql file: * MySQL Data Transfer Source Host: 10.0.0.5 Source Database: jnetdata Target Host: 10.0.0.5 Target Database: jnetdata Date: 5/26/2009 12:27:33 PM */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for chav...

Should i search content on database by id or name?

I have a CMS that has two menthods to query contents. One that queries by id and another one queries by the name of the content. ContentManager.Select(12); or ContentManager.Select("Content Name"); The way I see the first one would be faster, because the id is an index and doesn't invlove string comparison. While the second one is ...

How to drop a table in PostgreSQL which includes double quotes in its name

I accidentaly created a table in PostgreSQL which contains, in its name, some double quotes. I used SQL Server 2000 DTS to import data from it to my PostgreSQL server, but while importing, it created the table but with double quotes in it. Actually the table name when I do SELECT * FROM pg_tables is : public","t_freemailer So, when I t...

How to refresh a test instance of SQL server with production data without using full backups

I have two MS SQL 2005 servers, one for production and one for test and both have a Recovery Model of Full. I restore a backup of the production database to the test server and then have users make changes. I want to be able to: Roll back all the changes made to the test SQL server Apply all the transactions that have occurred on the ...

Why aren't OODBMS as widespread as RDBMS?

Why are relation databases more common than object-oriented databases? If the Object Oriented Programming paradigm is so widespread, shouldn't we see lots of OODBMS? Wouldn't they perform better than the RDBMS+OR/M? ...

Java - Prepared statements and arrays

How can I handle an array in a prepared statement? i.e, I want to do a query and one of the parameters I get is an array of strings which I want to use in the query (Don't select rows that have a field that's in the array)? ...

version control rails and databases, where to start?

I'm from an clientside language programming background, specifically ActionScript. So although I'm fairly code aware I have very little server side experience, particularly version control of databases along with the rails application itself. And then there's the command line which is a complete mystery. Right now I'm building my first ...

Free SQL comparison tool

I have been using SQL Compare by Redgate at my company and was very satisfied with it. Are there any free comparison tools that are similar? Or what would be my best shot for synchronizing two SQL db's without a paid application ...

Search-friendly way to store checkbox values in MySQL?

What is a search-friendly way to store checkbox values in the database? Currently, checkboxes are processed as an array and values are separated by a ";" As such: <input type="checkbox" name="frequency[]" value="Daily"/> Daily <input type="checkbox" name="frequency[]" value="Weekly"/> Weekly <input type="checkbox" name="frequency[]" v...