mysql

Dynamic Foreign Keys - How To Implement?

I have 4 tables (appointed, class, elected, status) that I want to cross reference into a single table's (members) column. The values of the of 4 tables are time sensitive based off a history table (members_history). The desired result is that the query should output all members and the current appointed position or current elected posit...

What MySQL datatype & attributes should be used to store large amounts of html formatted data?

I'm setting up a database using PHPMyAdmin and many fields will be large chunks of HTML. What MySQL datatype & attributes should be used for fields that store large amounts of HTML data? ...

Compiler warnings with MySQL++ with release configuration.

For some reason I get some warnings about "non dll-interface class" when building with a release configuration, but not debug. I've compared the release and debug configurations, and my ones with the MySQL++ example ones, however I cant see which setting is causing these warnings. 1>c:\sql\mysql 5.0\mysql++-3.0.9\lib\qparms.h(49) : war...

MySQL Join Syntax

I'm having problems understanding the MYSQL join syntax. I can't seem to manipulate it for my purpose. I have had to use work arounds for months which have resulted in extra queries just for retrieving one extra column. Scenario: I have two tables.. Table.Stories - containing stories and the user ID of which whom added it. id, story,...

Split Column with MySQL

Hello, I recently took over a project that has a pretty dirty database... The table "users" has a "phone" column... The problem is that the column holds multiple phone numbers separated by "/". I would like to put all of these in separate columns (phone 1, phone2, phone3 etc) But have no idea what the best way to do it is. Is it possibl...

Indexed CHAR(255) field in MySQL... Is it optimal?

MySQL table with couple of fields: id - PRIMARY KEY url - CHAR(255). url field is also unique and indexed. Currently have couple of hundreds of thousands entries in that table. MySQL gets really slow. The idea is: if I add hash BIGINT UNIQUE INDEXED field, and create composite index hash/url - will it work faster? Means will MySQ...

Zend Framework app not closing mysql connections properly

I'm having a weird issue using Zend_Db's PDO adapter for managing my database connections. All of a sudden, I'm constantly hitting the connection limit on my MySQL server. For whatever reason, every three or four hours or so I end up getting this error, and Apache craps out on every HTTP request with this error: PHP Fatal error: Un...

Transfer MySQL to SQLite

I want to start using Core Date on iPhone with pre-existing MySQL databases. What's the easiest way to transfer a MySQL database to SQLite? I've tried using SQLite Migrator, but I don't know where to find the ODBC drivers for Mac (Snow Leopard). I found http://www.ch-werner.de/sqliteodbc/ which seems to have drivers, but they are for Po...

Many to many tables and querying on the same variable with arrays

SOLVED - see Bish below I've got a list of checkboxes that all dump to $fruitid[], and a many-to-many table1: BoxID FruitID 01 01 01 02 02 01 02 03 02 04 03 02 etc. etc. I want a user to check the box next to each fruit they want, and then query to pull up a list of each box that contains all...

MYSQL union or order by?

I am trying to figure out how to grab information from my database in the order that I want to. For example, I have the names below in my database: Matt Jimmy Craig Jenny Sue I want to get them out in this order: Sue Craig Jimmy Matt Jenny How would I do that using MYSQL? ...

MySQL: What's wrong with this query?

SELECT u.user_id, u.first_name, u.last_name, i.path AS image_path FROM bgy_users u LEFT JOIN bgy_images i ON i.image_id = u.image_id WHERE u.commentary_id = '0' Error: Unknown column 'u.image_id' in 'on clause' When there definitely is a column image_id in table bgy_users What am I doing wrong? Result for DESCRIBE BGY_USERS Re...

mysql ndb cluster "information_schema.tables" query

I am using Mysql NDB Cluster, in my information_schema.Tables tbl I have null entries in the colummn called Create_Time and Update_Time. Does anyone have any known solution for this. as on my normal innodb databases the Create_Time and Update_Time is there properly. ...

Charset problem, MySQL and get_meta_tags()

Hello, I'm trying to get HTML meta tags with PHP by using get_meta_tags() function. I'm using UTF8 for tables, charset/collations, as connection charset to MySQL and everything else. But unfortunetely MySQL cuts off the string when inserting to table. It happens while HTML encodings are different than UTF-8 (for example ISO 8859-1) Is...

Zend_DB - Use native MySQL adapter instead of MySQLi or PDO?

The server I'm porting to doesn't have PDO nor Mysqli extensions enabled ( though it is running PHP5 ). I don't see any MySql.php class in Zend/Db/Adapter - is there some convention to using native MySQL? Or some sort of workaround? Perhaps using an older version of Zend? And I don't have access to modify the php.ini. ...

losing my objects at cache

I am using IIS7 and c# and mysql. and I put some objects into asp.net cache system with sql keywords. it has very simple logic.put the selected dataset into cache with the given sql keyword. here is the problem. when I call my site with www.abc.com it works normal. while surfing in abc.com after second click firstly filled dataset becom...

What native mysql class should I port to from Zend_Db? ( No PDO or Mysqli )

I'm dealing with a client who has a legacy cPanel account where the php installation was not compiled with PDO nor Mysqli therefore my Zend_Db code is useless since it relies on either of those. What library/class should I go with? ...

Images in MySQL

Hi, Is there a Image related data type in MySQL that can be used for storing images for each record. Appreciate your help. Cheers! Anil ...

Registration and Session with PHP and MySQL

Hello boys and girls. I'm looking for an in-depth tutorial of registration and session management using PHP and MySQL. Sorry if this is the wrong place to ask for this, but i really haven't been able to find a good tutorial elsewhere. Cheers! ...

How can I use mysql bit from using DBIx

Hi, I am trying to access a mysql bit field in my catalyst app. Here is the table info: SQL: create table foo{ ... mybitField bit(1) NOT NULL default b'0' } My mapped table: ... mybitField { data_type => "BIT", default_value => "b'0'", is_nullable => 0, size => undef, } ... Now in my controller, I do a simple...

MySQL select from view with user variables - Unexpected result

I have 2 tables and a view. In product_oper I have some products that I receive (when id_dest is 1) and that I sell (when id_src is 1). The table product_doc contains the date when the operation took place. CREATE TABLE product_doc ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, doc_date date NOT NULL, doc_no char(16) NOT NULL,...