mysql

Fastest and most efficient way to fetch a record from Remote MySQL to iPhone

What is the fastest way of getting a single record from a MySQL database on the server side to an iPhone native app? The return type is NSString ...

Facing problem working with PDO for mySQL

while using the following constructor $this->pdo = new PDO ($this->source, $this->username, $this->password); if I do not have any password then should I pass a NuLL value for creating a new instance of PDO? ...

Search mysql database using php

Hello! I want to implement a powerful search engine for my ecommerce application. im using php and mysql as database. Can anyone guide me how to proceed? Is the FULL TEXT feature of MYSQL good for a large volume of data? Thanks! ...

how to access phpmyadmin and type username and password?

Up until now I can't figure out why is phpmyadmin inaccessible when I put a password on the root user. But I've seen someone accessing phpmyadmin and inputting a username and password. How do I do that, so that I can access phpmyadmin even when I put a password to the root user. Because maybe by default the login form is inaccessible. D...

Retrieve multiple images from MySQL

How to retrieve multiple blob images from MySQL database in JSP page? ...

MySQL queries and text search

I have this query: select name, body from news where body like %MyWord%; I use MySQL database engine. this query will return name, body when found MyWord in body text. My problem here is that, when I search about two word in body text, like MyWord1 , MyWord2. or more !!! How I can do that if you know that this query is calling by...

One mysql table with many fields or many (hundreds of) tables with fewer fields?

Hello, I am designing a system for a client, where he is able to create data forms for various products he sales him self. The number of fields he will be using will not be more than 600-700 (worst case scenario). As it looks like he will probably be in the range of 400 - 500 (max). I had 2 methods in mind for creating the database ...

Update row according to result number in result set

I am looking to do the following: tblOne: -page_id -split tblMany -view_id -page_id I want to order tblOne by the number of related page_id in tblMany. Then divide the number of rows in tblOne by 5 and update tblOne.split to a number between 1 - 5 into which split it falls... e.g if there are 50 rows... row 0 - 9 are split 1, 10 -...

Query with Ruby on Rails

Hi: I'm struggling with a rails query. Finally, I want to make a JSON response with the following contents: A listing of all countries which have at least one company, associated through "Address" and a count of how of how many companies reside in a country. Here is my simple model structure: class Country < ActiveRecord::Base has_...

Displaying a Blob back as a Image in php without header("Content-type: image/jpg");

Im pulling the binary data out of my mySql database and want to display it as a image. I do not want to make a separate page for it to display the image (this would involve a extra call to the databae among other things) I simply want to be able to do Pretty much but the $Image variable is in its longblob format and I need to conve...

show create view definition

When I do "Show create view viewName" it does the display the correctly formatted text. I will like to know if there is any way to format it exactly like "show create table tblName"? ...

Hierarchical Database, multiple tables or column with parent id?

Hi, I need to store info about county, municipality and city in Norway in a mysql database. They are related in a hierarchical manner (a city belongs to a municipality which again belongs to a county). Is it best to store this as three different tables and reference by foreign key, or should I store them in one table and relate them w...

PHP: Get primary key of table?

Hello! Is there a way to get the name of primary key field from mysql-database? For example: I have a table like this: +----+------+ | id | name | +----+------+ | 1 | Foo1 | | 2 | Foo2 | | 3 | Foo3 | +----+------+ Where the field id is primary key (it has auto increment but I can't use that). How can I retrieve fields name "id" i...

Updating MySQL primary key

I have a table user_interactions with 4 columns: user_1 user_2 type timestamp The primary key is (user_1,user_2,type) and I want to change to (user_2,user_1,type) So what I did was : drop primary key ... add primary key (user_2,user_1,type)... and voila... The problem is that database is live on a server. So befo...

Need help on a MySQL search query

Hi, I need some help on a MySQL query I'm trying to set up. I need to find records that match conditions that are located in two different tables with a many to many relationship. I use three tables in this query, the first contains projects, the second contains topics and the third ties them together. I want the query to find projects...

Import single database from --all-databases dump

Is it possible to import a single database from an --all-databases mysqldump? I guess I can modify the file manually but wondering if there are any command line options to do this. I am moving servers and have a lot of databases, most of which I don't currently need or want at the moment but would like to have the option to restore a si...

Getting checkbox-selected data from Table A inserted into Table B

[Status: Learner] I have a Table A with thousands of records. On each displayed page, only 20 rows are showing, with the following fields: check last_name first_name gr eth sex id_num (a unique value) reason start_date The "check" field indicates a checkbox that the user can tick. At the bottom of each page of 20 records is t...

Looking for best CMS for MySQL Document based project, with CSS, PHP and Javascript

New project, to transfer existing Windows App to Web, Document based database with Report query and generator. What CMS sytem would be best? ...

How do you recommend I handle a database design where a USER can have many SKILLS?

Here's my database design: USER SKILLS id idUser email 1-------* description name selfAssesedLevel lastname yearsExperience ?skills? reference How could I handle this? I'm kind of lost on what I have to write down in ?skills? field of the USER table. ...

MySQL concatenating fields but ignoring empty ones

I have a MySQL db with a list of people, including their address, which I want to return as one field in a query. It's split into address1, address2, address3, address4, post_code and I want to do something like the following SELECT CONCAT(`address1`, ' ', `address2`, ' ', `address3`, ' ', `address4`, ' ', `post_code`) AS `address` FRO...