mysql

Help with a troublesome SQL query.

We have three tables: p: <` +-----+-------+-------+--------+--------+ | pno | pname | color | weight | city | +-----+-------+-------+--------+--------+ | p1 | nut | red | 12 | London | | p2 | bolt | green | 17 | Paris | | p3 | screw | blue | 17 | Rome | | p4 | screw | red | 14 | London | | p5 | cam |...

data access object in python

hello , 6 months ago , i was asked to make a database access for our project that has around 30 tables ,( using the Data transfer object pattern ) . we were using Microsoft's sql server back then. so i had to write a script that automatically generates the DAO's and DTO's.( automatically build classes, name them appropriately according...

How much extra storage does MySQL fulltext index consume?

I am looking for a way to estimate how much extra storage will be needed if a MySQL TEXT column gets a fulltext index. Intuitively speaking the size of the fulltext index is dependent on the total length of text but what exactly is affecting it? ...

Suggestion needed for optimizing a MySQL query.

I'm using parameterized queries with PHP I have the following two queries: SELECT username,question_text FROM questions,users WHERE questions.question_id = 4 AND questions.user_id = users.user_id and SELECT username, post_text FROM posts,users WHERE posts.question_id = 4 AND posts.user_id = users.user_id ORDER BY posts.post_id AS...

MySQL timestamp select date range

Not sure really where to start with this one. Can anyone help/point me in the right direction. I have a timestamp column in MySQL and I want to select a date range for example, all timestamps which are in Oct 2010. Thanks. ...

PHP need to display MPTT without modifying MySql database

I have a MPTT organized MySql database which i need to display , there is no level limit and i can't alter the database, i've tryed http://dev.mysql.com/tech-resources/articles/hierarchical-data.html, but still got me a few headeachs. ...

MySQL query help

Hi All, Need a help in building query. I have quantity_price table, listing quantity and corresponding price as shown below Quantity Price ---------------- 1 -- € 175,35 2.5 -- € 160,65 5 -- € 149,10 10 -- € 143,85 so for upto 1 quantity price will be 175,35 up to 2.5 it will be 160,65 and so on. For more than 10 quantity...

Error: Timeout expired with transactions, MySql and Asp.net

I have a Asp.net web service that I connect to and that insert, update or delete max 30 rows in a large MySql table using transaction to make the process faster. The whole process should just run in a few secs. Sometimes I can see in the logs that the user gets error: Timeout expired. The timeout period elapsed prior to completion of th...

to sync local database and web server database in MySql

I am using PHP and Mysql for developing an application. we have two copies of database, one at local server(i.e our end) and one at web server. we want to sync both the database so that if any change made in local database should also reflect on the webserver database. is that possible?? Currently we are using PHP scripts to do so..which...

merge a insert/select statement into one? mysql

Is there a way to make this statement into one? The basic idea is to insert a tag name if it doesnt exist and to retrieve the primary key for my next statement. title column is unique. INSERT INTO `tag_name` (`count`, `title`) SELECT 0, @title FROM DUAL WHERE not exists (SELECT * FROM `tag_name` WHERE `title` = @title LIMIT 1); ...

The underlying provider failed on Commit.

Hello, In my mvc asp.net application, I have various modules in that I have insert and edit functionality. Some time I am getting this error: at System.Data.EntityClient.EntityTransaction.Commit() at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) at System.Data.Objects.ObjectContext.SaveChanges() at admin.ch...

How to "LIMIT 50000,1"?

So, LIMIT 50000,1 won't work well? Then, how come? What to do if rows after several rows are required? I read it at http://www.mysqlperformanceblog.com/2006/09/01/order-by-limit-performance-optimization/ ...

T_CONSTANT_ENCAPSED_STRING blocking ip.

Here is line 37; $write = mysql_query("INSERT INTO `trial' VALUES (" '', '".$ip."', '1' ") or die(mysql_error()); The error may be coming from further up.. But I'm not quite sure :S I am trying to block the ip of a ...

How do you pull beans related by foreign keys in RedBeanPHP?

I'm using RedBean PHP ORM 1.2 with Zend and Mysql for a new project. I'm still in the process of learning it and it works very well for many scenarios, except i cant find how to load beans related by foreign keys. Allow me to explain. I have two tables; members and feeds. Each 'feed' is linked via a foreign key (in MySQL) to a member. T...

How to upload large SQL Files?

Hi I have a large sql file < 600 MB. This files is backup for forum and I want to upload it to empty db. How I can upload it?? I can't use PHPMyAdmin? and I used BigDump and it doesn't insert all tables. How to do it?? Is there any other way? Thanks EDIT : I don't have access to command line, I just have my CPanel ...

Get Insert Statement for existing row in MySQL

Using MySQL I can run the query: SHOW CREATE TABLE MyTable; And it will return the create table statement for the specificed table. This is useful if you have a table already created, and want to create the same table on another database. Is it possible to get the insert statement for an already existing row, or set of rows? Some ...

Multiuser web-based calendar based on php, mysql, javascript

Hi there, I'm searching for a multiuser web-based calendar system that supports multiple users. I'm looking for these features: Multiple users Two user groups: First group is allowed to see events, the second group can create and edit events The events should be stored in a mysql database or a file The system has to be (very) easy to ...

Convert timestamp to a readable date during query

How can I tell MySQL to format a timestamp as a readable date before outputting a query result in a MySQL client/console? ...

commercial license for MariaDB

hi there, I'm currently working on a closed-source commercial web-project which uses MariaDB as database. I wonder about the licensing of MariaDB. Does anybody know, if we had to get a license to use it with our commercial project? On the website, they mention the "GNU General Public License, version 2". What means that exactly? http://...

Mysql Multiple querys

im currently running multiple mysql querys but want to just run one and loop through it. how can i improve this $query = mysql_query("SELECT productid, code, size, quantity, sizechart, rprice, price, weight FROM inventory WHERE code = '$productcode1'"); while ($rows1 = mysql_fetch_array($query)) { $productids1 = $rows1['productid']...