mysql

Can MySQL fulltext search be adapted to search for partial words?

I implemented MySQL fulltext search and worked perfect. Now the client wants that partial matches be found by the search, for example the term 'base' should match 'database'. I know the whole idea of fulltext search is based on word delimiters, and searching for full words. I know I most likely will have to use an undesirable LIKE '%$ter...

Am I reinventing the wheel? PHP/Mysql User reigstration and payment processing.

I'm about to code a php/mysql platform that does the following: Admin panel User registration Paypal payment processing Paypal subscription handling via api so that the user doesnt have to have a paypal account Does something like this already exist that I can use? If nothing exists like this, I'm going to code it fresh in the zend ...

MySQL: how to get records with count > 1?

I have a sql like this: SELECT *, count(*) as cc FROM manytomany GROUP BY aid, bid ORDER BY cc DESC which return all records with the count #. however, what can I do if I only want to get the ones with count > 1? ...

MySQL: Alternatives to ORDER BY RAND()

I've read about a few alternatives to MySQL's ORDER BY RAND() function, but most of the alternatives apply only to where on a single random result is needed. Does anyone have any idea how to optimize a query that returns multiple random results, such as this: SELECT u.id, p.photo FROM users u, profiles p WHER...

mysql + ruby = nightmare

Ok, I'm done. I can't understand why I got this error with: rake features It cant' be I can't connect to mysql cause the: rake db:migrate works perfectly. I keep having this error: rake features --trace (in /Users/myname/Projects/rails_app) ** Invoke features (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_...

Database: When should I use a composite index?

When should I use a composite index in a database? What are the performance ramification by using a composite index)? Why should I use use a composite index? For example, I have a homes table: CREATE TABLE IF NOT EXISTS `homes` ( `home_id` int(10) unsigned NOT NULL auto_increment, `sqft` smallint(5) unsigned NOT NULL, `year_bui...

Very interesting! Mysql do not support 𝑴 ?who know why?

In firefox you can see M of 𝑴 but can not see in IE8. HEX is f09d91b4 And google can convert it to M from %F0%9D%91%B4. Only see two blank square in notepad. who know why? ...

Correct MySQL JOIN format to avoid nested SELECT

I have two separate SELECT statements: SELECT VCe.VId FROM `VCe` WHERE `YId` = 9007 AND `MaId` =76 AND `MoId` = 2851 SELECT r_pts.p_id FROM r_pts WHERE r_pts.v_id IN (57202, 57203, 69597, 82261, 82260, 69596, 69595, 82259) When they are run separately they both complete in under .05sec however when I nest the first one within the sec...

what encoding stackoverflow used in mysql?

I can not save the character 𝑴 in my mysql which encoding is utf8, but i found stackoverflow can save it and display it. I made a mistake. stackoverflow also can not save 𝑴 . ...

MySQL sort by calculated value of 2 rows

I'm trying to create a MySQL statement that will sort by a value calculated within the statement itself. My tables look like this: posts +----+-----------+--------------+ | ID | post_type | post_content | +----+-----------+--------------+ | 1 | post | Hello | | 2 | post | world | +----+-----------+-------------...

PHP / MySql Insert on GoDaddy

I'm using heredocs for a php/mysql insert statement on godaddy. When the function is called the page refreshes correctly, however, the data is not being inserted into the database and no errors are appearing. I've tested locally using MAMP and when the file is uploaded to the server it does not work. Has anyone had this issue before o...

Any site out there that let's me run test SQL queries on sample databases?

You wanna test a GROUP BY on some sample data in the browser without having to install a DB engine and you don't have a remote access to any cloud database? Yeah, me too. Let's say it is for educational purposes. MSSQL or MySQL flavoured SQL would be nice. ...

How do you find out the DayOfTheWeek given a datetime in MySql ?

Given a datetime column in mysql 5, I want to find out the day of the week ? But the function DAYOFWEEK returns 1 for Sunday. I want 1 to denote monday, 2 tuesday etc.. and 7 to denote Sunday. Is there a one-liner (that can be embedded in a larger SQL statement) that implements this function ? f(x) => y such that: f(1) = 7 f(...

SQL: Auto Increment question

I have a table with an auto_increment field and sometimes rows get deleted so auto_increment leaves gaps. Is there any way to avoid this or at the very least write an sql query that a) alters the auto_increment value to be the max(current value) + 1 and b) return the new auto_increment value? I know how to write part a and b but can I ...

Php Multi-Dimensional Array / MySql problem

Hi My fellow geeks I am trying to write a php script that take a text file break down its contents and and insert it into a MySql database, the code is as follows: $file = "my_file.txt"; $db = "db_name"; $link = mysql_connect("localhost","root"); if(!$link) die("Connection Failed"); mysql_select_db($db) or die("Could not open ...

data porting problem in mysql

in porting data from one mysql database to other .. there have come some errors like appostrophe's have got converted into †.. in a field called story . why did this happen and what should i do now to correct the new database. i have only the phpmyadmin access of the two databases ...

what is the mysql command to remove all occurances of some charachter like †in particular collumn of tableA in databaseA

what is the mysql command to remove all occurances of some charachter like †in particular collumn of tableA in databaseA . this collumnn is a text area collumn whose each row contains a paragraph of text. ...

Merge virtually two mysql tables

Hi ist there a way to merge two tables in MySQL virtually so I could query and insert data? (which is basicly splitted) exp. table id active foo table_meta table_id language text what I like to do is using something like this instead of sql-join INSERT INTO table_join SET active = 1, language = 'en'; regards jim ...

how to duplicate a mysql table along with data using phymyadmin

how to duplicate a mysql table along with data using phymyadmin ...

A SQL story in 2 parts - Are SQL views always good and how can I solve this example?

Hiya, I'm building a reporting app, and so I'm crunching an awful lot of data. Part of my approach to creating the app in an agile way is to use SQL views to take the strain off the DB if multiple users are all bashing away. One example is: mysql_query("CREATE VIEW view_silverpop_clicks_baby_$email AS SELECT view_email_baby_posit...