mysql

How to optimize mysql full match

Hey guys, do you know some trick about how can I optimize more a full match search? The code that I'm trying to optimize: $do = $this->select() ->where('MATCH(`name`,`ort`) AGAINST( ? IN BOOLEAN MODE)', $theString) ->order('premium DESC'); The search should search for some companies...and let's say that in the field name ...

mysql query tuning

Hello, I have a query that I have made into a MYSQL view. This particular view is central to our application so we are looking at tuning it. There is a primary key on Map_Id,User_No,X,Y. I am pretty comfortable tuning SQL server queries but not totally sure about how MySql works in this aspect. Would it help to put an index on it tha...

search canadian province

Hi, I have an input search on the site and I want to search in the database (MySQL) after province name. In database I have just the provinces initials - ex: QC for Quebec, AB - Alberta, etc. The people can introduce into the input search field: QC or PC or Province du Québec or Province Quebec or Quebec or Québec (capital letters or ...

Question about Hierarchical data

I am reading the following article, http://articles.sitepoint.com/article/hierarchical-data-database/2 about"Storing Hierarchical Data in a Database". This is talking about these structures. http://sitepointstatic.com/graphics/sitepoint_numbering.gif and http://sitepointstatic.com/graphics/table02.gif I don't understand the following p...

mysqli_fetch_assoc empty the data?

i get some data from mysql. $result = $forum_model->get_info($_SESSION['group_id']); // step 1 while($user = mysqli_fetch_assoc($result)) { some code } but when i later some lines beneath want to use the same data pulled out from mysql it doesnt work. // step 2 while($user = mysqli_fetch_assoc($result)) { some code } is...

MySQL row order for "SELECT * FROM table_name;"

Assume that the following query is issued to a MySQL database: SELECT * FROM table_name; Note that no ORDER BY clause is given. My question is: Does MySQL give any guarantees to which order the result set rows will be given? More specifically, can I assume that the rows will be returned in insertion order (that is the same order in ...

When to fix auto-increment gaps in MYSQL

The database I am working on right now has records being added and removed by the 10s of thousands and because of this there are gaps in the auto-incremented key hundreds of thousands big and auto-increment numbers well into the billions. These numbers are never stored to reference the individual record but are used to reference the re...

store video in a mysql database, allow user download

I need a multimedia database I want to be able to upload video directly to the database Allow user to search database and then download as file when found shared host with php and mysql ...

Simple MySQL problem

I'm working on a MySQL database that contains persons. My problem is that, (I will simplify to make my point): I have three tables: Persons(id int, birthdate date) PersonsLastNames(id int, lastname varchar(30)) PersonsFirstNames(id int, firstname varchar(30)) The id is the common key. There are separate tables for last names and firs...

storing forum posts in mysql

phpBB stores forum post texts in a strange way (like: [BLOB - 115 B]), what is it? How it is done? ...

row order when inserting multplie rows in MySQL

In PHP, I create and execute SQL queries like the following. INSERT INTO Table (Column1, Column2, Column3) VALUES ('1', '2', '3'), ('A', 'B', 'C'), ('AA', 'BB', 'CC'); However, the order in which they are inserted into the database is different every time I try this. Is there a way that I can ensure that they are inserted in the order...

There are two columns in the new table(table1 join table2) which have the same column name, how to get the values of both respectively

select * from table1 join table2 on table1.column3=table2.column4 where ... ... $row=mysql_fetch_assoc($result); However, there are two columns in the new table(table1 join table2) which have the same column name, how to get the values of both respectively? ...

Joining two SQL tables with GROUP BY not achieving desired results

For example, I have a shop order database, and two tables in it - ORDERS and ORDERSTATUS. Table : orders -------------------------------------------- OrderID | OrderItems | AddedTimeStamp | -------------------------------------------- 1 | Apples | 2009-12-22 13:15:18 | -------------------------------------------- 2 ...

MySQL MyISAM table locking

Does a MySQL MyISAM table gets locked when records are deleted from it? ...

Sync between Sql Server and Mysql Server

Hi, I have 2 big tables in sql server that i need to sync to mysql. now, i need that as an ongoing process. the tables are 1 GB each and getting new/update/delete row every 0.1 second. Can you recommend me a tool that can do it that is not resource expensive. you can offer OPEN SOURCE and commercial as well Thanks ...

Recovery of Data History

i have a table as show StudentTable S.no StudentName Marks 1 Stud1 100 2 Stud2 350 3 Stud3 400 Here the marks column for each student will get updated upon each test. lets Consider Stud1, Stud1 got 50 Marks in 1st Test and 50 Marks in 2nd Test. Totally 100. I know the dates when the tests are held. Is th...

Unable to load libmysql.dll

hello all I am trying to use dbexpress component first time to connect to mysql i got this error Failure to Connect : Unable to load libmysql.dll my delphi version : Delphi7 mysql 5.1.36 (wamp server installed on my windows). can any one help me in this thanks in advance ...

<o:p>&nbsp;</o:p> < o : p > & nbsp ; < / o : p > display error

Hello Whenever i receive an email from MS outlook i get this tag < o : p > & nbsp ; < / o : p > (without the spaces) which display's as ? in a <>. Browser page charset encoding is UTF-8 when i change it to ISO-8859-1 the symbol disappears but my other characters goes wrong. I have to use UTF-8 How can i remove this tag sequence. PHP ...

PHP/MYSQL - Backing up mysql data that changes by the second.

I have a mysql table (A) that's taking in hundreds to thousands of inserts per second. Every 15 minutes I'd like to move all that data to table (B) and delete all the data from (A) without interrupting/missing the new rows going in. Suggestions? Tips? ...

SQL: Finding user with most number of comments

I need to find out the user who has posted the most number of comments. There are two tables 1)users(Id, DisplayName) 2)comments(Id, UserId, test) . I have used the following query Select DisplayName from users INNER JOIN (Select UserId, max(comment_count) as `max_comments from (Select UserId, count(Id) as comment_count from comments gr...