mysql

How can I get EclipseLink to create MySQL InnoDB tables?

It generates MyISAM tables by default. I don't want to have to get it to generate a DDL script and then edit that if I can avoid it. I would also like to avoid changing the default table type of my MySQL installation unless I can do that for online one database. Any ideas? ...

Company Logo Doesn't appear in IE8

i have an situation like that in a mail message company logo doesn't apppear.. it just dispalys the empty box ...

How to store and retrieve date values

Please i want to Insert data date in "textbox" with PHP to myssql. But i can't do it. And show it with format "dd/mm/yyyy" in table ...

Migrating a database from MS SQL to MySql - How time consuming / difficult is it?

A client wants a database converting from MS SQL to MySql. Personally I wouldn't do this, I prefer MS SQL for larger databases and like the tools available when working with MSSQL. However I do use MySql on smaller projects. I've never moved a database from one to the other, or made much use of sprocs when using mysql. Is there a lo...

Hierarchical MAX

Is there a way to get a row that has the MAX() when two fields are considered, giving one of them precedence. For example ID Column_A Column_B ---------------------------- 1 1 3 2 3 2 3 2 2 4 3 1 Would return ID Column_A Column_B --------...

com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

Hi i have mysql under my hibernate and i am also using c3p0-0.9.1 for connection pool !. when running in my laptop (i mean localy) i have no errors. but on when i deploy it on the server , i got this exception com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory...

binary log files analysis

I had used a tool to open and analyze the binary files. The output used to be insert into table1 update table4 insert into some_other_table It used to show how many insert or update statements where there in the binary file. It was useful to know if the server is inserting/ deleting records or if there are heavy updates happening. I...

Search a query in multiple MySQL tables

hey guys i just want to search ( Select ) in multiple tables , so i wrote bellow code : SELECT s.title From table_stories s WHERE s.title = %$inputbox% UNION SELECT e.title From table_pages e WHERE e.title = %$inputbox% is it wrong to use UNION >?! ...

mysqli_real_connect() often takes around 5 seconds,even on developing environment

mysqli_real_connect($connection, $url['host'], $url['user'], $url['pass'], substr($url['path'], 1), $url['port'], NULL, MYSQLI_CLIENT_FOUND_ROWS); What's the reason that it can take much time to make a connection? Now about 3 out of 8 connections will hang for 5 seconds or even more. ...

Saving more than one tickbox to one DB column

Hi guys, I have a bunch of tick boxes that need to be inserted into one database column on submit, but I have no idea on how to accomplish this, I was thinking maybe jQuery or Javascript, any ideas? Here is a snippit of code: <input type="checkbox" name="vehicle" value="Bike" /> <input type="checkbox" name="vehicle" value="Car" /> s...

Incorrect Date Exception

I am trying to enter a date with with year 1900 using java into sql bt i am getting exception as : 'com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '1900-01-01 00:00:00' ' ...

How can I enable the user to enter reserved characters into the database with a combination of PHP, MySQL and AJAX?

Hi, I've set up a website that allows the user to add places to a database. However, I am unfamiliar with regex and so I'm not sure how to allow characters like apostrophes and dollar signs without them affecting the database INSERT. I have a form, which is read by AJAX and processed with PHP/MySQL so there's thee languages which have t...

Php explode or unique Mysql table for user's friends?

Hello, I will create frienship system for my project. I couldn't decide whether I should store friends in a column at user's row or create a friends table and store there with user IDs? To clearify which usage is better: Should users table be like this? +-----------+-----------+---------------+ + id + username + friends ...

MySQL default time format UTC or GMT ?

Hi I'm so confused with this UTC and GMT I'm inserting in MySQL table as ex column "event_date" like "2010-07-01 23:50:00" (datetime) my client asking an option in front end as GMT +1 GMT +2 GMT -1 GMT -2 ...etc if I select any option GMT +2 the event_date will filter/list according to the GMT +2. I have no idea how to proceed and aft...

Mysql resource into PHP array not working.

I have posted this yesterday, I didn't get the the answers that could solve my problem but I got some pretty good ideas anyhow. This code retrieves the associated row from the db and translates it into PHP array so I could display it as a profile info. Here's my current code: Query: <?php require 'includes/constants.php'; class newMy...

mysql Stored Procedure, Query to check if exists or not..

Hi, i am looking for a possible MySqL query which will check to see if a stored procedure exists on the database server, if it does great Return, if it doesnt then i can insert it using c#. any help is appreciated Vade ...

MySQl GROUP BY and ORDER BY not doing what I want

I want to sort my results before grouping them, but I can't seem to get it done. I have this query: SELECT DISTINCT product.id, product_number_value.att_value AS product_number, color_number_value.option_code AS color_number, size_value.option_code AS size_code, size_value.option_position AS size_position FROM product INNER JOIN...

What's the fastest way to make a multiple field search in MySQL?

Hi there! I'm trying to achieve a really fast search engine for a MySQL db with several fields. The problem relies on the fact that I need to match a value (keyword) against several fields, in a %like% approach. I don't mind relevancy (the order is fixed), just performance. The queries are pretty complicated (lotta JOINS, 3 or 4 tabl...

Why can't a text column have a default value in MySQL?

If you try to create a TEXT column on a table, and give it a default value in MySQL, you get an error (on Windows at least). I cannot see any reason why a text column should not have a default value. No explanation is given by the MySQL documentation. It seems illogical to me (and somewhat frustrating, as I want a default value!). Anybod...

How to cache results

I heard that a lot of big project administrators caches results. I wonder how do I do it? Thanks I'm using PHP. ...