database

PHP mySQL not letting me insert into a table

Hey, I'm using the code: function insertV($deptx, $coursex, $secx, $isbnx,$titlex, $authorx,$usedpx,$newpx) { $sql = "INSERT INTO `$deptx` (`course`, `sec`, `isbn`, `title`, `author`, `usedp`, `newp`) VALUES ('$coursex','$secx','$isbnx','$titlex','$authorx','$usedpx','$newpx')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysq...

[PHP] Multiple database in single query is possible?

[PHP] How can I query a data from two database in one statement? Please give me the easy way. and How to connect 2 database to use it? Thank you ...

Does my repository have too much logic?

I have a legacy database that my new application has to interact with. The old database is over-normalized and poorly designed in general. For instance, one object in my domain represents five tables in the database. I want to keep my domain layer free of artifacts from the legacy database. What pattern should I use here? At first glanc...

How to persist application model

My c# application needs to persist its model classes to disk. Initially I tried to do xml serialization. However when I do breaking changes in my model (split one class to two) the saved xml will not deserialize (which is understood). I thought about applying xslt to upgrade the xml but the xml generated is really complex. Is it a good...

SQL Select With Multiple References to Single Table

I have a SQL DB that contains multiple relational tables. There are some fields in the master table that reference another table multiple times. For example, say I have a database of salesmen who are responsible of sales for multiple states. My database has fields for State1, State2, and State3 all of which map back to a States table....

How are bitmap indexes helpful?

Wikipedia gives this example Identifier Gender Bitmaps F M 1 Female 1 0 2 Male 0 1 3 Male 0 1 4 Unspecified 0 0 5 Female 1 0 But I do not understand this. How is this an i...

Coming from a relational database background, how should I model relationships in db4o (or any object database)?

I'm experimenting with db4o as a data store, so to get to grips with it I thought I'd build myself a simple issue tracking web application (in ASP.NET MVC). I've found db4o to be excellent in terms of rapid development, especially for small apps like this, and it also negates the need for an ORM. However, having come from a SQL Server/M...

How to open large (HUGE) textfiles.

I am writing a program to produce random records in a format that can be specified in code and optionally write it to disk as a text file so it can be used for datamining benchmarks. My problem is that I can verify that my program works with small text files but I need to know if this is true for large amounts of data (this program will...

SQL Help - How to "linearize" data?

I'm not sure if "linearization" is the proper term, but I need a query that will output something like this: item_name item_price first_name last_name ----------------------------------------------- 'camera' '100' 'Little' 'Timmy' 'computer' '200' 'Little' 'Timmy' Here's my DB: http://pastebin.com/iS4QKHEb...

Using Rob Camick's ListTableModel, but JTable doesnt show up

I'm Using Camick's ListTableModel and RowTableModel from here http://tips4java.wordpress.com/2009/03/12/table-from-database/ However, the JTable is not showing up. Does anyone know why? I'm not getting any errors. import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; public class AddressBook { JLabe...

Massive Wordpress database migration

This is a doozy of a question... I am developing a new wordpress website to replace my client's massively sized blog (tens of thousands of pages). Their existing blog is built on a custom PERL blogging platform from 1992...so as you can imagine, it needs updating. My job is to find the BEST possible way to migrate all of their existing...

How i should design database ER-Diagram for this problem.

Hello! i have some specific question to solve but i can not think. I have 5-6 statements that I need to store in my database. This system like a news feeds. Statement 1 : A installed this website. Statement 2 : A added store R in provinceX Statement 3 : B reviewed store R Statement 4 : A edited store R Statement 5 : A added product...

(SQL) How do I query for a list of items that share attributes while listing the rows independently?

Hi All, Having a bit of a "special" moment here. Basically I have a DB table for listing files and their attributes (size, creation date, etc). Being a self-proclaimed (borderline delusional) SQL-whiz, you can imagine my surprise when I failed to figure out a quality manner by which to individually list only files whose [INSERT ATTRIB...

MySQL InnoDB unlock a row

I get a lock timeout when updating a certain row in the database. Other rows update okay. #1205 - Lock wait timeout exceeded; try restarting transaction How can I unlock this particular row? Here are the two related tables. I'm trying to update the email on user. I don't think tenant should be causing any problems though. CREATE TA...

How many queries in one webpage?

How many queries in one webpage is good performance? If that page is home page that is viewed many times. and how about.... $sql1 = mysql_query("SELECT * FROM a", $db1); while($row = mysql_fetch_assoc($sql1)){ $sql2 = mysql_query("SELECT * FROM b WHERE aid='a'", $db2); $a = mysql_fetch_assoc($sql2); } is it good? acctually I can ...

Editing Word files stored in a Database

We want to store Microsoft Word templates in our database. Then we wish to allow the user to edit the template files and then store them back to the database. What is the best strategy to use in this situation? Is this possible if we have Word running in a separate process? i.e. not hosted in our application. If so would this involve mo...

To separate to a different table or use enum type?

I'm working with an online shop, currently products are either available or not, and enabled or not, by an int field on the products table. They want me to add more to this, e.g. "in stock with supplier", "out of stock, ships within x days" etc. I'm thinking of just ditching the flags and creating a status field of enum type, with 'ava...

What are the advantages & disadvantages of having your own database for OpenStreetMap?

Hi! I'm doing a Route Planning Application using OpenStreetMap. The target area is the National Capital Region of the Philippines. I need the road vector data and some of the other POIs for the project. I'm thinking if it is better to get the data (the .OSM files) and place it in my own database or contribute to the Online database inste...

In Oracle, why are the columns of type LONG created last?

This Oracle documentation page mentions ... columns of type LONG are created last but doesn't say why. What can the reason be to store them at the end of a row? ...

Database sync between iphone's local db and a remote central db

Hi evry1, i 've a local database running in iphone app loaded from sqlite....now i need to sync the local db with the database on the server if the user wishes to do so..can any one help me with this.... Thanks in advance!! ...