I'm new to PHP, and I am creating a basic CMS using PHP and MySQL. I'm struggling to get the checkbox information from my HTML page across into the database.
How can I make the values to appear as binary 0 or 1 values?
The HTML document is written as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w...
Is it things like tables? Or would it also include things like constraints, stored procedures, packages, etc.?
I've looked around the internet, but finding elementary answers to elementary questions is sometimes a little difficult.
...
Lets say that I have a database structure with three tables that look like this:
items
- item_id
- item_handle
attributes
- attribute_id
- attribute_name
item_attributes
- item_attribute_id
- item_id
- attribute_id
- attribute_value
I would like to be able to do this in SQLAlchemy:
item = Item('item1')
item.foo = 'bar'
ses...
I'm trying to genericize (if that's even a word) the following line of code:
oCmd.CreateParameter("@Date", SqlDbType.DateTime, updateDate > DateTime.MinValue ? updateDate : SqlDateTime.Null);
The first change is obviously SqlDbType.DateTime to just DbType.DateTime, what do I do with the SqlDateTime.Null?
If I change to:
oCmd.CreateP...
I am learning database right now -- and some of the queries are getting just plain crazy. I know that during query optimization you may sometimes rewrite queries in different ways to minimize certain things. I am looking at a correllated subquery example and see that it results in the same resultset as a LEFT JOIN.
I am thinking that...
I'm having a bit of trouble with one particular issue using JPA/Spring:
How can I dynamically assign a schema to an entity?
We have TABLE1 that belongs to schema AD and TABLE2 that is under BD.
@Entity
@Table(name = "TABLE1", schema="S1D")
...
@Entity
@Table(name = "TABLE2", schema="S2D")
...
The schemas may not be hardcoded in an ...
Hi,
I'm looking for a Java (or Groovy) solution for managing static data i.e. data in infrequently changing tables such as a list of countries.
I would like to keep the list of countries in a text file and have the tables automatically updated when the server starts. I can't simply delete all the tables, then re-insert the data in the ...
I am trying to do a SELECT match on a table based upon an identifier and a price, such as:
SELECT * FROM `table` WHERE `ident`='ident23' AND `price`='101.31';
The above returns zero rows, while if you remove the price='101.31' bit it returns the correct row.
Doing a...
SELECT * FROM `table`;
Returns the same row as above and qui...
Hi there,
Is it possible to host a silverlight application on a classic asp page? I see examples where the silverlight application is hosted on a html page, and I do understand that Silverlight is a client side language, but since I need to pass data from the page to the silverlight application, I am not too sure what to do.
PS: the si...
I am trying to use Npgsql to invoke a function (stored procedure) that takes a CHARACTER as parameter, but it doesn't work. If I declare the same function without parameters, or with an INTEGER parameter, I get the result sets that I want. When I declare the parameter as CHARACTER, it stops working. What is wrong?
Here is the code of my...
Hello guys,
I'm studying high-performance coding for websites in PHP, and this idea popped into my mind:
We know that accessing a database uses a significant amount of CPU usage, so we cache such data, saving it to the HDD. But I was wondering, can't it rest in the RAM of the server, so I can access it even more faster?
...
I've got Django set up to run some recurring tasks in their own threads, and I noticed that they were always leaving behind unfinished database connection processes (pgsql "Idle In Transaction").
I looked through the Postgres logs and found that the transactions weren't being completed (no ROLLBACK). I tried using the various transactio...
I've got a table with approx 7 million rows of data.
The schema is something like:
ID - int (Primary Key)
Name - Varchar(250) Null
...
I want to set an index up for the Name column to speed up searches. e.g
Select * from table where name = 'ABC'
But what is the impact of setting up an Index on a varchar field? Index size? Does ...
A little presentation for what I want to do:
Consider the case where different people from a firm get, once a year, an all expenses paid trip to somewhere. There may be 1000 persons that could qualify for the trip but only 16 places are available.
Each of this 16 spots has an associated index which must be from 1 to 16. The ones on th...
I'll cut right to the chase. All I can achieve at this point with this class is a database connection. I am unable to make a query. Can you show me exactly how to get this working and/or show me how to recode it in a better way.
<?php
class database{
public $dbHost = '';
public $dbUser = '';
public $dbPass = '';
public $dbName = '';
p...
I am using a DBD::SQLite in memory database. I have defined the following indexes for a table:
CREATE INDEX x ON ss (a, b);
CREATE INDEX y ON ss (c, d, e, o);
Will the following select statement use these two indexes?
SELECT f, g
FROM ss
WHERE a = ? AND b = ? AND c = ? AND d = ? AND e = ?
And, I should only make indexes on those co...
I have a database design problem , where the database object's properties are not fixed. And the application user need to have option to add propery to the object at any time.
Since this can't be implemented in traditional database design with fixed number of columns, i am thinking about using key value pair design pattern
And i am loo...
Hello, I have a simple question but I don't know which term I should use to find the answer (english is not my first language).
I have a classical database design of products like and categories.
CREATE TABLE IF NOT EXISTS `a` (
`id_a` int(11) NOT NULL auto_increment,
`type` varchar(255) NOT NULL,
PRIMARY KEY (`id_a`)
) ENGINE=M...
How to connect with MySQL from Visual C++ Microsoft Visual Studio 2008 ? I tried googling and found solutions all of which ended with fatal errors like linker errors,... etc. Please explain (or provide a link) step by step, including prerequisites (with links) and all details. I don't need any query examples.. just connecting to MySQL. T...
Which is better (and for what reasons) to use to connect to MS SQL, Oracle or Firebird from a Delphi Win32 application -- ADO or DBX (Database Express)?
Both allow you to connect to the major databases. I like the way ADO does it all with a connection string change and the fact that ADO and the drivers are included with Windows so noth...