I m trying to get construct a sql statement where many to many relationship occurs. Basically i want to retrieve business based on 2 categories some business are included in both categories and queried through zip code. So far i got the zip code part but it doesnt distinguish the category and i don't have a table for the categories also ...
Hi everyone,
I am just starting out with the MySQLdb module for python, and upon running some SELECT and UPDATE queries, the following gets output:
Exception
_mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL
server during query') in bound method Cursor.del of
MySQLdb.cursors.Cursor object at 0x8c0188c ignore...
We are modifying osCommerce, but our architecture involves separate clusters for db reads and db writes.
Has anyone separated these out?
...
Hello, I am trying to do a dual-timetable system thing.
Basically, it's for a school project, and some schools have week 1 and week 2 systems.
The way this works is through alternating each week, so at the start of september, the school week starts on week 1, and the next week is week 2.
How would I implement this in PHP an MySQL?
...
Is there anyway to sort a column by name, and ignore the quotes that being some items?
For example:
"This is cool"
Another article
Article 2
Hello
Would sort as:
Another article
Article 2
Hello
"This is cool"
The quotes are already in the database...
...
I am trying to write a PHP program to automatically created backups of MySQL tables as sql files on the server:
$backup = "$path/$tablename.sql";
$table = "mydbname.mytablename";
exec(
sprintf(
'/usr/bin/mysqldump --host=%s --user=%s --password=%s %s --quick --lock-tables --add-drop-table > %s',
$host,
$user,
$passw...
I was wondering what is the best way to write the where statement in PHP where targetDate < Date.Now - HardCodedHours in PHP
...
i have a java program that is calling a Mysql stored procedure that is rolling back when it gets an SQLException. When i added the rollback (exit handler) to the store procedure the java program stopped getting the sql exception. i need for the java program to get a sql exception and the error message from mysql.
does any one know how...
My initial answer to this problem has been to script it. Instead of using SQL, I've dipped into Python and normalised them. I am curious whether anyone can come up with a solution using SQL though.
If a date occurs outside of business hours, I want to normalise the date to the next working day. I'll keep this really simple and say that ...
Hy there,
Bulk insert question on how to get lastInsertId.
INSERT INTO details (idactivity,user,hours,val,date) VALUES ('981','133','0','10500','2008-07-01'),('981','184','0','2750','2008-07-01'),('981','184','0','2750','2008-07-01')
(iddetails as details table PK)
Is there a way to get the 3 new iddetails and get them to the next bu...
What is the need for a database schema (embedded in the DB) if I can configure my MySQL DB structure and write CRUD statements to work with it directly? I've never worked with these, but I'm assuming they're only for performance optimization?
I know of schema diagrams that can be exported as .sql commands which generate the DB structure...
Recently I've began experimenting with ASP.NET MVC and the Entity Framework. Since my hostingprovider only provides me with MySQL I've been trying to set that up.
Locally everything works fine, but after I publish it I get the following error:
[ProviderIncompatibleException: The store provider factory type 'MySql.Data.MySqlClient.MySqlC...
I need a simple way for multiple running PHP scripts to share data.
Should I create a MySQL DB with a RAM storage engine, and share data via that (can multiple scripts connect to the same DB simultaneously?)
Or would flat files with one piece of data per line be better?
...
I'm trying to save a file (pdf or image) uploaded from a form into a MySQL database using Coldfusion. I'm saving the file as binary data into the database which has a column setup as a BLOB but having trouble writing the file back to the screen. What is the correct way to save a file in a database and then retrieve the file in Coldfusion...
I have a database in which a few fields are set as index. I don't know if this has to do with the problem or not, but when creating a query I get no results. Here is how I have things set in the database. The database has 90,000 records and this table is set like:
| fieldA | fieldB | fieldC | fieldD |
fieldA = index - CHAR
fieldB = ...
Hi all,
Say we have the following tables t1 and t2:
t1:
id | column_1
-------------
1 | 1
2 | 2
t2:
id | column_2
-------------
2 | 2
3 | 3
and we want to find the following result:
id | column_1 | column_2
------------------------
1 | 1 |
2 | 2 | 2
3 | | 3
This basically is the union of a r...
Hi
I have 2 tables: sets and groups. Both are joined using a 3rd table set_has_groups.
I would like to get sets that have ALL groups that I specify
One way of doing it would be
SELECT column1, column2 FROM sets WHERE
id IN(SELECT set_id FROM set_has_group WHERE group_id = 1)
AND id IN(SELECT set_id FROM set_has_group WHERE group_id =...
I imported some data using LOAD DATA INFILE into a MySQL Database. The table itself and the columns are using the UTF8 character set, but the default character set of the database is latin 1. Because the default character type of the database is latin1, and I used LOAD DATA INFILE without specifying a character set, it interpreted the ...
Let's suppose I have the following table (let's call it my_table):
CREATE TABLE `my_table` (
`table_id` int(10) unsigned NOT NULL auto_increment,
`my_field` int(10) unsigned NOT NULL default '0'
PRIMARY KEY (`table_id`),
KEY `my_field` (`my_field`,`table_id`)
) ENGINE=MyISAM
The primary key for my_table is table_id (auto_i...
Hi all,
Let us suppose the following table (e.g. a result of several inner join statements):
id | column_1 | column_2
------------------------
1 | 1 |
2 | 2 | 2
3 | | 3
Which you could for example get from the following statement:
select a.id, t1.column_1, t2.column_2
from a
left join t1 on a.id = t1.id
le...