mysql

PHP, MYSQL and hyperlinks - linking from one page to another

I have 2 php pages. One returning the id of the last 10 records of a MYSQL query and another returning all field values for a specific record. Can anyone help me link the two so that when I click on say row 3 (id = 3) of the table in the first page it takes me to the second page using the id 3 in the MYSQL query utilised by the second pa...

Does MYSQL stores it in an optimal way it if the same string is stored in multiple rows?

I have a table where one of the columns is a sort of id string used to group several rows from the table. Let's say the column name is "map" and one of the values for map is e.g. "walmart". The column has an index on it, because I use to it filter those rows which belong to a certain map. I have lots of such maps and I don't know how mu...

Storing an image in MySQL

How can I store and retrieve an image to a MySQL database using VB.NET 2005? ...

I need an expert mysql opinion for doing a friends system

I need some help designing a friends system The mysql table: friends_ list - auto_ id - friend_ id - user_ id - approved_ status Option 1 = Everytime a user adds a user there is 2 entries added to the DB, we then can get there friends like this SELECT user_id FROM `friends_list` WHERE friend_id='$userId' and approved_status='yes' ...

[MySQL] Case insensitive search without additional rules?

Hello, I'm trying to find a collation in MySQL (my version is 5.0) where strings that differ in case are considered the same but there're no other rules like: á = a and so on. I tried to find the proper collation here: http://www.collation-charts.org/mysql60/by-charset.html but it seems that the collation I'm looking for doesn't exi...

Processing MySQL query shown on progress bar

I have form that passes about 37 values to MS Access base with INSERT or UPDATE query. Actually it happens very fast so my wish to indicate this process on progress bar is just a fancy feature. How can I bind mysql query execution to progress bar filling? Or should I just emulate this relativity? ...

Finding ID having all values (mySQL, SQL)

Think about a table like this ID Value 100 1 100 3 101 1 101 4 102 2 102 5 103 2 103 4 104 1 104 3 105 2 105 5 The problem is, if I give values 2 and 5 I should get 102 and 105 which both 102 and 105 are having values 2 and 5 at the same time or if...

Workaround for missing descending index feature in MySQL

Hello! We have a problem with our production environment which uses a modified version of jBPM that has support for priorities. Indices present are: | JBPM_TIMER | 1 | JBPM_TIMER_DUEDATE__PRIORITY_ | 1 | PRIORITY_ | A | 2 | NULL | NULL | YES | BTREE | | | JBPM_TIMER | ...

mysql - adding primary key to a large table

Have a large table here with no primary key and im trying to add a column called "id" at the beginning of the table. Im using phpMyAdmin but cant figure it out. Its easy enuff to add a column, but how do u set up the auto-increment feature to automatically assign a key to each row? Any suggestions??? ...

conditional join in mysql

Hi, I have a table id1, id2, type. type is an enumerated value containing a name of another table. I'd like to preform a join with the name of the table of type. For example: switch($type) case 'table1': join table1; break; case 'table2': join table2; break; How can I achieve this? ...

MySQL get distinct values and count how many of each?

There is a status column. I need to pull all the distinct values for each one, and a number indicating how many times each unique value is in the table. Is there a way to do that? Thanks. ...

MySQL groupwise limit query

Say I've got a table: create table foo ( corp_id int not null, tdate date not null, sec_id int unsigned not null, amount int unsigned not null, primary key (corp_id, sec_id, tdate) ); The following query will return the sum of the amount column for all corp_id's and dates: select corp_id, tdate, sum(amount) from foo group b...

ft_min_word_len set in local my.cnf?

Is it possible to set ft_min_word_len for a certain user (such as by placing a my.cnf file in the user home dir with ft_min_word_len set)? The documentation says I need to restart the server after making this change, but a user does not have access to do that. ...

MySQL Database in Multiple Operating Systems

If i have a dual-boot system (XP and Ubuntu) with a shared data partition to store the database files in, is it possible to get both XP's and Linux's MySQL using the same database file when each one boots? Would it be as simple as changing the datadir setting in each configuration file and ensuring all other settings match? Would I need ...

merging data bt tables in mysql

Hi. I have three tables with the following structure: tb1: id(AI, PK), uid, date, text tb2: id(AI, PK), uid, date, text ... and so on I have to keep them separate because of additional unqiue data that each table has. I'd like to execute a query that will merge and get me the last 20 entries (ie, date DESC) (specifically, i need uid a...

Ruby datetime suitable for mysql comparison

Rails has been good with automatically inserting correctly formatted datetimes in MySql without the need for me to give it much thought. However, for doing a validation, I need to check if a stored mysql datetime value (ie 2008-07-02 18:00:00) is greater than or less than "now". I can call DateTime.now or Time.now but how can I convert...

MYSQL case sensitive search (using hibernate) for utf8

Hi every one, I have Login Table that have utf8 charset and utf8 collation when I want check user name and retrieve other information for this specific user name the hql query give me the same result with lowercase and uppercase. what should l do for my HQL query that work case sesitive I use Mysql 5 and java hibernarte this is my que...

Why does MySQL use the wrong index?

Hello! I have another question regarding optimizing mysql indices for our prioritizing jBPM. The relevant indices look like this: | JBPM_TIMER | 1 | JBPM_TIMER_REVERSEPRIORITY__DUEDATE_ | 1 | REVERSEPRIORITY_ | A | 17 | NULL | NULL | YES | BTREE | | | JBPM_TIMER | ...

Two columns in Mysql with uniqueness constraint between column1 and column2

Hi, Let us consider a user table: Username,email1,email2 Now, I want to make sure that no two rows in this table have any common email address. What would be the best way to ensure this ? E.g.: If table has row: "Bill,[email protected],[email protected]", then trying to insert a row like "Billy,[email protected],[email protected]" should give an ...

How to update a MySql DB using Flex

Hello everybody. Just got developing with Flex, and i like it. I've done some simple apps to get the felling of it, nothing involving updating a file or a database. I wanted help, how to do a query to a MySql DB from a Flex application (thats gonna be running in a web server). I didn't saw any duplicated questions, sorry if any exist...