mysql

Merging Bit, Enum and Set fields in MySql

I know up to eight Bit fields are merged into one byte to save space, but what if I have a couple of Bit fields and an Enum or a Set field? Are they internally merged too? I'm asking because I'm going to have a lot of rows in my table and I want to avoid overhead as much as possible. ...

PHP mysql - ...AND column='anything'... ?

Is there any way to check if a column is "anything"? The reason is that i have a searchfunction that get's an ID from the URL, and then it passes it through the sql algorithm and shows the result. But if that URL "function" (?) isn't filled in, it just searches for: ...AND column=''... and that doesn't return any results at all. I've ...

Mysql configuration errror : using password (NO) instead of YES.

Hello, I try to connect mysql via PHPMYADMIN, using my password, but it can't stop telling me that (access denied, using password NO) but i'm using a password :O When i connect via the console with my password, it works but not on phpmyadmin. It's really weird. Do you have an idea to fix that ? edit: it worked couple of days ago, b...

Automated ETL / Database Migration Solution

I'm looking for an ETL solution that we can create a configure by hand and then deploy to run autonomously. This is basic transformation, it need not be feature heavy. Key points would be free or open source'ed software that could be tailored more to suit specific needs. In fact, this could be reduced to a simple DB migration tool that ...

Seeking assistance with Escaping Data for MySQL queries

Please don't send me a link to php.net referencing mysql_real_escape_string as the only response. I have read through the page and while I understand the general concepts, I am having some trouble based on how my INSERT statement is currently built. Today, I am using the following: $sql = "INSERT INTO tablename VALUES ('', ...

Best way to handle MySQL date for performance with thousands of users

I am currently part of a team designing a site that will potentially have thousands of users who will be doing a number of date related searches. During the design phase we have been trying to determine which makes more sense for performance optimization. Should we store the datetime field as a mysql datetime. Or should be break it up i...

On MYSQL Join, I'm getting un unknown column error.

Here is my query: select s.*, u.display_name from wp_wdify_sites s, wp_users u LEFT JOIN wp_wdify_sitesmeta m ON (s.sid = m.site_id) where milestones like '%dateSubmitted%' and milestones not like '%dateArchived%' and u.ID = s.cid and did IN (0) and m.meta_key = 'aboutSite'` The er...

Is the Zend_Db_Table_Abstract->insert() function safe?

I am using the insert() function from Zend_Db_Table_Abstract. The data being inserted is user input, so naturally I am curious if ZF does the data cleansing for me, or if I should do it myself before I call the insert() function. ...

MySQL insert at end of table

Hello, I am using MySQL and PHP. I am having a problem with inserting a new item at the end of my table. When I insert the new item appears after the last created item, but I want it to be entered at the bottom of the table. Suppose that I have a table id=int,Primary Key and album=string and the table is: Wrath Crack The Skye Enter Shi...

Lost with hibernate - OneToMany resulting in the one being pulled back many times..

I have this DB design: CREATE TABLE report ( ID MEDIUMINT PRIMARY KEY NOT NULL AUTO_INCREMENT, user MEDIUMINT NOT NULL, created TIMESTAMP NOT NULL, state INT NOT NULL, FOREIGN KEY (user) REFERENCES user(ID) ON UPDATE CASCADE ON DELETE CASCADE ); CREATE TABLE reportProperties ( ID ...

Get data to android app from mysql server

Hi i have an mysql database with some sports results in it. I want to write an android application to display these data on mobile phones. I´ve searched on the internet for this issue and i think it is not possible to have a direct connection between the mysql database and the android application. (Is this right?) So my question is th...

Do i need to dispose of MySqlCommand?

I find it incredibly annoying to write a using statement on every one of my queries (which require its own command or write parameters.clear()) which sometimes require declaring variables outside of the using block. Its so incredibly annoying and looks much dirtier compared to the version without disposing the object. Do i need to dispo...

How to handle large table in MySQL ?

I've a database used to store items and properties about these items. The number of properties is extensible, thus there is a join table to store each property associated to an item value. CREATE TABLE `item_property` ( `property_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, `value` double NOT NULL, PRIMARY KEY (`pr...

SQL Randomization on Daily Basis

Hi, I have an SQL listing shops, but i would like to random the results on a daily basis. For example today I list bat 2, 6, 9 etc and tomorrow, 6,1,7,9 etc Is there a way to implement this? ...

SQL Server and MySQL connection pooling: is it really important?

After a lot of problems with my web host, I disabled connection pooling within my application. The problem was related to the number of concurrent connections : only five. The result is that my web app doesn't crash. I didn't notice any poor performance after disabling it. Are there any "collateral" or side effects to disabling con...

Retrieve part of a MySQL column with PHP

For instance, if I have the following table: +----+---+----------+ | id | a | position | +----+---+----------+ | 0 | 0 | 0 | | 1 | 0 | 1 | | 2 | 1 | 4 | | 3 | 1 | 9 | | 4 | 1 | 6 | | 5 | 1 | 1 | +----+---+----------+ and I want to get an array that contains the first 100 values from posi...

Using MySQL, is there any way to dump the count of records in each of all 200 tables in a database?

Say if there is a database that has 200 tables, is there a quick way to see how many records are in each table, if possible, sorted by the number of records descendingly? thanks. ...

PHP in Wordpress Posts - Is this okay?

I've been working with some long lists of information and I've come up with a good way to post it in various formats on my wordpress blog posts. I installed the exec-PHP plugin, which allows you to run php in posts. I then created a new table (NEWTABLE) in my wordpress database and filled that table with names, scores, and other stuff....

How can I use Django with MySQL in MAMP stack?

Hi all, I have difficulty especially in installing MySQLdb module (MySQL-python-1.2.3c1), to connect to the MySQL in MAMP stack. I've done a number of things such as copying the mysql include directory and library (including plugin) from a fresh installation of mysql (version 5.1.47) to the one inside MAMP (version 5.1.37). Now, the M...

Is there a way to combine IN and LIKE in MySQL?

I'm currently running a query like this: SELECT * FROM email WHERE email_address LIKE 'ajones@%' OR email_address LIKE 'bsmith@%' OR email_address LIKE 'cjohnson@%' The large number of OR's bothers me. Is there a way to condense this up with something akin to an IN operator, e.g.: SELECT * FROM email WHERE email_addres...