mysql

MySQL Cluster (Master/Slave) and Hibernate

The application when developed is using a single database and the spring configuration is as follows. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/test" /> ...

limit distinct keyword to one column

how do i apply the the distinct keyword in mysql so that it is only checking that one column field is unique, while still returning other columns from my table? ...

Mysql stored procedure : cant run from PHP code

I have below stored procedure to check the user name availability DELIMITER $$; DROP PROCEDURE IF EXISTS tv_check_email$$ CREATE PROCEDURE tv_check_email (IN username varchar(50)) BEGIN select USER_ID from tv_user_master where EMAIL=username; END$$ DELIMITER ;$$ when i run this from my mysql front end tool, it is working fine cal...

Is it bad to put a MySQL query in a PHP loop?

I often have large arrays, or large amounts of dynamic data in PHP that I need to run MySQL queries to handle. Is there a better way to run many processes like INSERT or UPDATE without looping through the information to be INSERT-ed or UPDATE-ed? Example (I didn't use prepared statement for brevity sake): $myArray = array('apple','or...

How to INSERT binary std::string into BLOB (MySQL)

I have binary std::string and I need insert it into the BLOB (MySQL) using simple data layer I have. So, I need to execute query: ExecuteSQL((LPTSTR)strQ). When I am creating this query string (strQ) I cannot add anything to the string after I add this binary string - it just kind if terminated and nothing can be aded. I do not want to u...

List of Stored Procedures/Functions Mysql Command Line

Dear all how can I see the list of the stored procedures or stored functions in mysql command line like show tables; or show databases; commands. ...

php & mysql subscribe to search/matching queries

I have a real estate website that has several categories. And i want the users to be able to subscribe via email to a certain list of offers, they can either be offers from a category ... or offers from a search list. How can i store they're subscription the best way in mysql ... and also how do i go about and do the notification. The ...

sql insert and update question

I have a form which to insert data into a database. This form takes the content of the fields, and then displays the result page showing the entered information in context. There is a link on this page to edit the user info, which go back to the previous form. Obviously, I do not want duplicate records inserted. Is there an easy way to u...

sql join question.

I have two tables, auctions and users. I want to select the username table from auctions where category=x, and then select the fields a, b and c from the users table, where the username field in users matches th username fields from auctions. I am trying this: SELECT AUCTIONS.USERNAME, USERS.firstname, USERS.lastname, USERS.flaggedauc...

Error when starting mysql on Mac OS 10.5

Hi, I had a problem with my MySQL installation here the other day. After doing everything I could think of to no avail, I decided to reinstall the whole thing. I installed the package format of the installation from mysql.com, and ran the installer. It installed it right where it was before i uninstalled it: /usr/local/mysql. So I try...

MySQL vs SQL Server 2005/2008 performance

I intend to start developing an ASP.NET application and I am wondering which database to use. Performance is very important and the database should be able to handle without issues a database of about 50GB. I am wondering however, if a SQL Server license is worth paying for. I have looked for performance and scalability comparisons betwe...

Is it possible to convert this query to use a join instead of a subquery?

SELECT number, count(id) FROM tracking WHERE id IN (SELECT max(id) FROM tracking WHERE splitnr = 'a11' AND number >0 AND timestamp >= '2009-04-08 00:00:00' AND timestamp <= '2009-04-08 12:55:57' GROUP BY ident) GROUP BY number ...

delete rows from multiple tables

I'm trying to use SQL to delete multiple rows from multiple tables that are joined together. Table A is joined to Table B Table B is joined to Table C I want to delete all rows in table B & C that correspond to a row in Table A CREATE TABLE `boards` ( `boardid` int(2) NOT NULL AUTO_INCREMENT, `boardname` varchar(255) NOT NULL DEFA...

How to access phpMyAdmin on remote server

For my websites I use Dreamhost. Dreamhost requires you to create a hostname (ex: mysql.mclindigital.com) that the database will reside on. For me it's simple, if I want to access phpMyAdmin, I simply navigate to mysql.mclindigital.com, and it enters into phpMyAdmin automatically. Apparently Dreamhost is in the minority using this met...

Best way to query calendar events?

Hi, I'm creating a calendar that displays a timetable of events for a month. Each day has several parameters that determine if more events can be scheduled for this day (how many staff are available, how many times are available etc). My database is set up using three tables: Regular Schedule - this is used to create an array for eac...

Reference stored procedure in another database?

From a stored procedure or function in a given MySQL database, is it possible to reference a stored procedure or function in another MySQL database, as follows? SELECT some_table.field1, some_table.field2, another_database.STORED_PROCEDURE(arg), ... FROM ... WHERE ... ...

beginner at mysql need some help please

Hi everyone, I have just started to learn PHP/Mysql and up until now have only been doing some pretty basic querys but am now stumped on how to do something. Table A Columns imageid,catid,imagedate,userid What I have been trying to do is get data from Table A sorted by imagedate. I would only like to return 1 result (imageid,userid) f...

Selecting date formats for aggregate calculations from database with Django

I would like to do aggregate calculations based on month for a datetime field. I am currently using the extra() function to format the date like: ...extra(select="strftime('column', '%m/%Y') as t").values('t').annotate(SUM(foo)) and it works great for sqlite3. In sqlite3 I can use strftime(), but that doesn't work with MySQL. In MyS...

Looking for a clean, efficient way to match a set of data against known patterns.

Using php5.2 and MySQL 4.1.22 I've come across something that, at first, appeared simple but has since evaded me in regards to a simple, clean solution. We have pre-defined "packages" of product. Package 1 may have products A, B and C in it. Package 2 may have A, C, D and G in it, etc. The packages range in size from 3 to 5 products. ...

Pros & cons of full text search engine Lucene, Sphinx, Postgresql full text search, MySQL full text search?

I'm building a Django site and is looking for a search engine. A few candidates: Lucene/Lucene with Compass/Solr Sphinx Postgresql built-in full text search MySQl built-in full text search Selection criteria: result relevance and ranking searching and indexing speed ease of use and ease of integration with Django resource requirem...