mysql

Worrying about scalability of a new site

I am building a webapp that has the following characteristics: It only has a small number of pages, home,contact us, about,singup,etc. Each user has one jquery-based page that allows them to drag/drop/manipulate DOM elements. When a user has finished manipulating elements they can hit Save and elements are sent via JSON to a PHP script...

What is the fastest case sensitive string comparision in MySQL?

I want to join two tables on a char column. The simplest way I use is: SELECT * FROM a JOIN b ON (a.text = b.text) This method is quite fast but it the comparison of field is case insensitive. I have tried STRCMP(.., ..) and .. LIKE .. instead .. = .. but both are far to slow. What is the best solution to join two tables on char colum...

Install mysqldb on snow leopard

I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am running snow leopard a...

Triggers: Adjacency List to a Nested Set

I have an adjacency list on a legacy system that I would like to query recursively (need to get subtotals, etc). Can I make a trigger in MySQL that either store in a separate table, or alternatively store in separate columns in the same table the "Nested Set Equivalent" of a given set? My set is like this: +-------------+-------------...

Adding a radio button against each record

The following code uses the DB extention provided by PEAR. I want a radio button against each record so that the user can select only one record from the list and submit. There can be hundreds of records from table. // Proceed with getting some data... $res =& $db->query('SELECT * FROM someTable limit 10'); while ($res->fetchInto($row)...

Group date as month

I have an SQL timestamp field and I need to group it by month like Jan, Feb, Mar, ... but in numbers (01, 02, 03, ...) I've tried GROUP BY DATE_FORMAT(i.push_date, '%Y-%m') But it's not working. ...

How to get unix timestamp interval between two datetime values most efficiently in MySQL?

This way surely works,but it calls UNIX_TIMESTAMP 2 times: mysql> select UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP('2009-09-23 22:07:42'); +---------------------------------------------------------------+ | UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP('2009-09-23 22:07:42') | +---------------------------------------------------------------+ | ...

Threads get stuck in MySqlCommand.ExecuteNonQuery()

I want to make the calls to a method parallel. In this method I calculate some value (very fast) and write the value of this calculation into a database table. Therefore I use a Threadpool ThreadPool.QueueUserWorkItem((state) => { method(); }); After a while of calculation (not deterministic, the time when ...

AMFPHP Flex Propel Mapping class ultra-weird bug

Hello, I'm working on a website using : - Flex 3.4 - AMFPHP 1.9b - Propel 1.3 - PHP/MySQL My problem is really strange and I've been spending hours trying to know where it comes from. I'll try to focus on the problem which takes place in a whole system. To sum up, I have 2 entities (MySQL) : create table AAA ( id_AAA ...

Drupal field values and longtext

Hey there. Long time mysql/php user, first time Drupal user. Actually, I'm not doing the Drupal development (I'm just using the database to pull in some data to a separate application), and I'm just trying to figure out if this is how it's supposed to work: Every one of the "value" fields in the content_type_* tables is of type LONGTEXT...

MySQL % question

I'm working with survey data. Essentially, I want to count total responses for a question for a location, then use that total to create what percentage of all responses each particular response is. I then want to group results by location. An ideal output would be similar to this: Q1 | State | City | % yes| MA | bos |10 no | MA ...

configure apache tomcat 6 with mysql

have changed web.xml and jsp to details for mysql and also put mysql drivers in classpath. yet unable to connect. mysql server of wamp running on port= 3306 and socket= /tmp/mysql.sock what necessary changes do i have to make in my application ...

Invoking a PHP script from a mysql trigger

Is there anyway invoke a PHP page / function when a record being inserted in to the mysql db table. We dont have control over the record insertion procedure.Is there some thing called trigger which can call a PHP script back ? ...

How to generate unique id in MySQL?

I'm programming a script using PHP and MySQL and I want to get a unique id (consisting of a string: capitals and small letters with numbers) like: gHYtUUi5b. I found many functions in PHP that can generate such numbers but I'm afraid about how to ensure the id is unique! UPDATE: uuid is long, I mean such id like: (P5Dc) an 11 alphanum...

What is the best way to approach OpenSocial integration via PHP?

I'm looking to implement OpenSocial on my web application, which is written in php/mysql. What is the best way to go about doing this? For instance, are there options along the way? Is one path better than another? What should my scope be for a good first version? I just want to get it working for version 1, is there a logical path to a...

Finding all caps in columns?

When working with MySQL, how can I fetch all rows where the name column is all uppercase? Since equality is case insensitive, I'm not quite sure how to do this. ...

How to measure how exactly a column matches a pattern?

I'd like to have the results of my full text search in MySQL sorted by how completely the pattern covers the match. For example searching for apple in a nutrition database should sort "apple, raw" higher than "apple fritter" since 5/9 > 5/12. I can do this rather trivially outside the database, but i'm looking for a query that'll do it...

django registration module

i started to learn django using the official documentation tutorial and in turn created this registration form. i have the whole app setup but am stuck at how to process the data. i mean the documentation is a little tough to understand. if i can get some help, it would be great. this is how the models are setup: class user (models.Mo...

Database binding for ocaml ?

Hi, I'm trying to find a lib to access a DB from an Ocaml program. After trying ocaml-sqlite, I'm not satisfied since it's somewhat slow. I've seen a mysql module but it doesn't seem to be maintained. thanks. ...

Mysql as a PHP DSO

I have a server that is running live (in process of turning it into a dev server but need some stuff off it first) so we don't want to recompile php to break anything. On the new server we have the dynamic extensions of mysql.so and mysqli.so I haven't been able to find anything about the details of building one myself, so copied them o...