database

Wordpress Database Fatal error

I'm receiving this error when trying to run a php script against my wordpress DB: Fatal error: Cannot redeclare class wpdb Can anyone help me to resolve this? Edit Code: require_once(dirname(__FILE__) . '/../../wp-config.php'); require_once(dirname(__FILE__) . '/../../wp-includes/wp-db.php'); $wpdb->show_errors(); $dupes = $wpd...

Grouping related items in PHP

I have some rows in a database which represent line items in a sale. Each line item has five columns: id : Primary key. sale_id : The sale that this line-item is a part of (a foreign key to a Sales table). product_id : The product this item corresponds to (a foreign key to a Products table). group : The line-items group that this item ...

Why is a hot backup size smaller than a cold backup size?

Or is it not true at all.. ...

Keep repeating labels in db?

If I have repeating labels throughout the site - is it a good way to keep them in a database so that I can change all of them in one place? Or is there some other way? ...

Automating reverse engineer database model with Visio

We develop and maintain our database schema with a custom tool. SQL scripts and runtime files are generated from that tool. However, it does not provide a very good visual representation. Lately I been using Visio to reverse engineer the schema. This is working great so far. But to be able to do this, I need to: create an empty databa...

Are there any existing solutions for creating a generic DNA sequence database with a website front end?

I'd like to create an rRNA sequence database with a web front end for the lab I work in. It seems common in biology to want to search a large number of sequences using alignment algorithms such as BLAST and HMMER, so I wondered if there is any existing php/python/rails projects that allow easy creation of a generic sequence database with...

Strategies regarding composite indexes and cardinality

Does cardinality play a role in composite indexes? If so, what? I was running a query that was joining on two columns and it used what I thought to be a sup-optimal index, so it's making me rethink how I design indexes... Let's say we had a table that listed all of the Cities in the United States. My first instinct here is to make a cl...

Application creating user account in MySQL

I am creating a C++ application the uses a MySQL database. I would like the application to create an account for itself, if possible. I have not found a method to do so. Everytime I port my application, I forget the set up sequence. The current set up sequence requires creating an account in MySQL for the application to use. Once ...

How do I lock a MySQL DATABASE so that write/read/update/delete ..everything is locked?

I want to lock everything--completely. Very simple. Just prevent things from changing!! Will this work? use mydatabase; flush tables with read lock; ... unlock tables; Edit: But, it has to be available for replication. ...

Executing Dynamic SQL in Oracle (PL/SQL) and Ensuring Security....

If I have a valid SQL string; is there anyway I can execute it in my PL/SQL - but guarantee that it is a SELECT statement only...without doing complex parsing to ensure it doesn't have any escape characters/nested commands or any of that jazz? EDIT: What I'm really trying to accomplish is a generic, built-in to my application, querying...

What is the fastest way to insert a large amount of records into a SQL Server DB?

I need to insert millions of records being read from disk into SQL server. I am parsing these from a file on one machine, in what is a single-threaded process. Ideally I would want it to perform well if the SQL server is local or remote. It has to be done programatically in C#. ...

Comparing rows from two tables and and ouputting the result

Hello guys I've been trying to compare two similar tables that have some different columns Table 1 has columns ID_A, X, Y, Z and Table 2 has columns ID_B, X, Y, Z If both values from columns X or Y or Z are = 1 the result of the query would output columns ID_A, ID_B, X, Y, Z I thought it would be an intersect statement in there, ...

How to add data to db rows fetched with ZF?

I'm using Zend Framework's Zend_Db_Table classes to fetch data from a database. I'd like to "refine" each row I fetch from a table by adding something to it. Within a plain old SQL query I would write eg. SELECT *, dueDate<NOW() AS isOverdue. In this example, feeding an extra field to the SQL query would be possible, but sometimes it mi...

Remove HTML tags from string saved in database - ASP.NET

I am using ASP.NET 2.0 and SQL Server 2005. I am saving a value/string in the database such as............ <P>Test 1</P><P>Test2</P> Now i want to decode/remove the html tags and display it properly to the user such as.... Test 1 Test 2 I have tried this but it does not work! txtDesc.Text = VALUE FROM DATABASE What am i...

Need free English dictionary or Corpus, ultimately for a MySQL database

Hey there, I'm trying to find a free downloadable dictionary (or Corpus might be the better word) which I can import into MySQL. I need to words to have the type (noun, verb, adjective) associated with them. Any tips on where I can find one? I found one several years ago that worked nicely, but I no longer have it around. Thanks! Chris...

Why I have NullPointerException here?

I have created a class which name is Manager and I have a Frame which name is BirthList and this frame has a table.I work with MySQL and I have entered some data in the "birthtable" in MySQL.and i want to add those data from MySQL table in to the table which is in my frame . HINT: birthList is a list of Birth objects. but I will find thi...

CodeIgniter - continue on SQL error?

Hi Basically I have a table with a couple of columns marked Unique. I have a script that dumps a bunch of values into the table with a command like this: $this->db->query("INSERT INTO `table` (`col1`, `col2`, `col3`) VALUES (`val1`, `val2`, `val3`)"); Every so often my script will try to insert a row which would violate the uniquenes...

Creating new SQLite DBs with PDO

I want to provide a setup feature in my next project and I'm wondering if it's possible to create a SQLite 3 database from scratch with PDO or I'm just stuck at connecting to existing databases via DSN? If it isn't possible with PDO is there any way to create a new DB via PHP? ...

Io exception: There is no process to read data written to a pipe.

I'm using Hibernate3.2+Websphere6.0+struts1.3.. After deploying ,application works fine. After some idle time ,i will get this type of error repeatedly,am not able to login at all. Im not using any connection pooling. i feel after idle time its not able to connect to the database again..if i restart the server everything works fine for ...

How to test an Oracle function that contains DML in PLSQL Developer?

Selecting the return value of an Oracle stored function that doesn't contain DML can be done by simply selecting the function: select function_name() from dual; If the function contains DML (in this case some inserts to log the arguments passed to the function), the above query is not allowed. (ORA-14551) How can I select/view the re...