mysql

How to do weighted MySQL match search

Hi guys, so we can use mysql to search for full text indexed fields via the MATCH keyword... my question is...is there a native way to do this in which certain column's index is given greater weight than the other So for instance if I search using the indexes title, keywords, and description...is there a way to make entries in title a...

What is the Best way to kill database Routine(repeated) work in php

What is the Best way to kill database Routine(repeated) work in php , i work daily with php & mysql through pdo and other libs , but i feel i repeat myself over and over ADD , DELETE , UPDATE , especially in admin panel , every task require these operations , its kill the programming enjoyment... ...

How to decrease MySQL connection time

I have a JSP page. It used to work well but it becomes very slow (15 seconds to load) after the Systems team upgraded the Solaris 10 OS server. I checked all the queries in that page and every query works fine. In fact they are all very simple queries. And there are only about 300 entries in each related table. The only special thing,...

Best MySQL Table Structure: 2 Parents, 1 Child

I have two parent tables, BusinessGroup and SocialGroup, and one child table, Members. A Member can belong to either parent, but not both. As far as I can see, there are two options for constructing the child table. Opt 1: Include a field for ParentType, and another for ParentID. The ParentType would be an enum (Business, Social) and...

MySQL Date Between Subquery Question

Ok, I have a subquery that I am trying to work with and was needing a complicated question answered. There is a SQL tool that is being used to generate reports. With this tool, you can select dates as long as the date is in the outer select statement. So, you can use this tool to select a date range for instance from a simple select stat...

When should we use `` or '' in mySQL?

Hello all, CREATE TABLE `counties` ( `id` int(11) NOT NULL auto_increment, `county` tinytext NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; -- INSERT INTO `counties` VALUES (1, 'Alachua County'); I have seen some patterns here. People uses `` to surround field names and use '' to surround values. Is that true? Or the major rea...

String handling in T sql for mysql

I have a variable DECLARE url varchar(3000) and incoming parameters scheme VARCHAR(5), subdomain VARCHAR(55), domain VARCHAR(55), tld VARCHAR(55) yet when i do the following: SET url = url + ltrim(rtrim(scheme)) + '://'; SET url = url + ltrim(rtrim(subdomain)) + '.'; SET url = url + ltrim(rtrim(domain)); SET url = url+ '.' + ltrim...

PHP & MySQL - How to count the number of records

Okay so I have this web site search script and I'm trying to count how many records will be displayed when the user enters there search term or terms. I was wondering how would I be able to do this when i don't know what keywords will be entered? Below is my search query. Here is the part of my PHP & MySQL search code. $search_explode...

Display image from MySQL database in a UITableView iPhone

I have some image data stored in BLOB format in MySQL database, I fetch the string and integer data but for image it does not display. i also tried using a UIImageView but it doesn't work. Can some one please post some code to display the image data in a UITableView. NSData-->UIImage-->image display. Thanks ...

Converting MySQL DDL to SQL Server DDL

I have a model that was generated for MySQL 5 but now I need to create these tables on a SQL Server installation. It's been years since I mucked with SQL server and I want to make sure I can convert this script to be compatible. I don't really know what to look for TBQH, so without further ado, here's my MySQL DDL CREATE SCHEMA IF NOT...

Parse date in MySQL

How to convert the following into date for insertion/update into a TIMESTAMP or DATE field in MySQL? '15-Dec-09' DATE_FORMAT() is used to format date, but not the other way around. ...

MySQL LIMIT question

I'm using pagination for my search results but for some reason my pagination is not working correctly with my search script. I can't seem to find the correct place to put the LIMIT $start, $display in my search query code where ever I put it in my code it displays the pagination all wrong. Can some one please help me? Here is the part o...

Reg: Mysql replication

Hello All, I have a slave where i had changed my changed my.cnf ibadata as follows innodb_data_file_path = ibdata1:1000M:autoextend before changing this in my.cnf the file size of ibdata1 is : 6.4 G this was working fine but after restaring the all the tables have been changed from innodb engine to myisam could any one please expla...

mysql load data infile where clause

I need to update existing rows in table with load data infile based on some condition, is this possible? load data infile 'E:/xxx.csv' into table tld_tod @aaa, @xxx_date, @ccc fields terminated by ',' LINES TERMINATED BY '\r\n' set xxx = str_to_date(@xxx_date, '%d-%b-%y') where xxx is not null and aaa=@aaa ...

generate html or excel or pdf document for mysql database

Dear All, I have a database schema and i want to generate a document in any format(html or pdf or excel) of all the tables,stored procedures ,triggers for mysql .Please suggest a suitable tool which can provide all the documents ...

MySQL IF conditions and internationalization

Hello, I'm wondering the following, the query below will select the appropriate fields if a language is set. First question, I need the fields, title, keywords and description from the pages table or, if the language matches and the field is not null the page_langs table. Now I do this with three IF statements, is it possible to do this...

MYSQl Optimize Table Of Blog Posts With Comments

Hi, Im making a mysql table which will be holding my blog posts and some of their information. I want to be able to add comments the the blog posts and have them saved in mysql. My question is weather I should make a table called comments and have all the comments there have the blog post id, so I would only select the corresponding com...

difference mysql_errno and mysql_error

Can any one Explain the difference mysql_errno and mysql_error ? Thanks in advance ...

PHP & MySQL - Pagination display problems.

For some reason my search script will only display the first set of results for the first page but when I click on the pagination link to the next page the results that are generated from the search script will not be displayed how can I correct this problem? Here is my PHP & MySQL pagination code. $x = ''; $construct = ''; if(isset($...

PHP Chat SCript

I am developing a chat application. At present its just a simple chat. But i need a chat with chat rooms, database storage,admin can see all the chats.Any ideas...pls suggest me ...