MySQL is an open-source, relational database management system.

learn more… | top users | synonyms (3) | mysql jobs

0
votes
0answers
2 views

Can you use one single product layout page to display products once clicked on?

Okay ive been trying this for ages now and seem to be head-butting a wall everytime. I want to use one single page with pre-defined divs, layout etc. as basis so that when a product is clicked on from ...
0
votes
0answers
10 views

Mysql index with multiple columns

I am using Rails 3.0.20. My DocVisit model looks like default_scope where(:active => true) belongs_to :customer belongs_to :department belongs_to :order belongs_to :patient I have following ...
0
votes
3answers
18 views

SQL subquery select from returned results

SELECT ip, COUNT(ip) as count FROM gnb_full_log GROUP BY ip This returns table with ip and count columns. I would like to select records with count = 1 OR 1 < count < 6
0
votes
2answers
7 views

Mysql COUNT VS num rows performance

I want to select the amount of forum posts compared to a list of users. So it will look like this: USERID --- FORUMPOSTS 3647 - 2 7467 - 14 2673 - 39 3224 - 5 ... and so on Now I'm asking if it would ...
0
votes
0answers
35 views

Back button Issue in Php page

I have a Php MySQL admin module where some authenticated details has been stored and displayed.When i switch from one tab to other its okay but if ever i click the back button then it shows ...
0
votes
0answers
38 views

mysql line breaks formatting

I have an application which has a always worked with no issues. fast forward to today all formatting is broken. basically i am inserting a plain text emails to mysql db, something that has worked for ...
0
votes
4answers
15 views

How to change a column name and display with special characters?

I am trying to display one column name with '%' i.e the "ip_utilization" column as "usage%" column here. But i am not able to, can anyone suggest a solution please. I am sharing the query. select ...
-1
votes
0answers
18 views

How can I check if message was read?

<div id="navbar"> <a href="profile.php">Pilot File</a> &nbsp &nbsp <a href="pirep.php">Submit a PIREP</a>&nbsp &nbsp <a ...
-1
votes
1answer
19 views

How to Reorder MySQL Field Contents? (i.e. fname lname to lname, fname)

I have a MySQL database with a field that contains names separated by semicolon in the format firstname lastname. i.e. John Doe; R.J. Smith; Peter T. Thompson; Sabine Geiß How would one reorder ...
0
votes
2answers
29 views

MySQL Query not returning all rows according to echo ouput

I'm having trouble with a MySQL query, I really can't figure this out. The database is like this: ID = 1,2,3,4 | Currency = CAD, USD, GBP, EUR Output from the following code is: 1 1 1 1 C C ...
0
votes
0answers
9 views

Dynamically change database due to WHERE MySQL Crystal Reports

I'm programming with .NET 4.5, VS 2012 with CrystalReports in and MySQL (the last ^^). I have 3 or more tables named like "rp31_bla_2012_bla" or "rp31_bla_2013_bla" or ... Imagine you have a table ...
0
votes
2answers
21 views

How to send Android GPS coordinates to MySQL every 5 secondes

I'm trying to get GPS coordinates from Android and send it to MySQL database. Everything is working well, but the program enters into unlimited loop :because I used While (true) to updates the GPS ...
0
votes
0answers
12 views

Is it possible to create a trigger to copy values into same field in another row (in the same table)?

I have the following table test with the fields id (PK), Project Code (CFK), item code (CFK) date_code rows could look like: id, project code, item code, date code 1, project1, item1, ...
0
votes
0answers
19 views

MySQL & PHP: Consolidate MySQL query results

I have a PHP application retrieving data from a MySQL DB. When PHP queries the DB, results are pulled and all the output rows are printed to the screen, but at the top a graph is also printed giving a ...
0
votes
3answers
26 views

Load single column of CSV into MySQL

I have a csv file that is formated as follows: Rank, URL 1, www.google.com 2, www.facebook.com etc... I have a table with structure url, source, date_added Where each csv file has a different ...
1
vote
1answer
20 views

Group Concat Results Cut Off

I'm using the following query and it's returning the expected results.. except for the fact that the concatenated results appear to be cut off. Example: "1965 Chevrolet Suburban, 1958 Chevrolet Bel ...
0
votes
0answers
32 views

MySQL error. Works locally but not remotelly

I have this code $savechanges = $dataserver->prepare("UPDATE hub_apps SET aname=?, aicon=?, aimage=?, atype=?, aurl=? WHERE id = ?"); $savechanges->bind_param('sssisi', $_POST['app_name'], ...
0
votes
0answers
4 views

Execute two insert query codeigniter 2

When i try to execute two insert query , the first works and the second doesn't , This is my code : foreach ($data as $key => $value) { $this->db->insert('db_purchased', ...
-1
votes
0answers
14 views

MySql: How to get fields that start with a certain value?

I have an indexed VARBINARY column (storing an array of integers) and I need to look-up all fields that start with a certain byte-array. It could also be TEXT or VARCHAR and you need to look for a ...
2
votes
3answers
39 views

Make a simple format (MySQL)

The goal Convert 99999999 into 99999-999. The problem I do not know the syntax. What I already thought about I was thinking to useFORMAT() function — but I'm working with INT instead of DECIMAL. ...
0
votes
3answers
14 views

How to insert to mysql from asp.net using vb?

I am trying to insert into a mysql table. Here is my code... Dim cmdText = "INSERT INTO complete_log ('cust_id', 'business', 'note', 'date_stamp') values (@cid,@bus,@notey,@datey)" Dim ...
-2
votes
3answers
28 views

Mysql Combining the values of multiple columns

I have searched for the answer to this and cannot find it anywhere. Not quite how I want anyway. I have five Mysql columns in a table, that I want to combine to make one column. column1value | ...
0
votes
1answer
26 views

MySql Query with UNION and SORT

Actually i am trying to create a conversation interface like FB(Messages) and for that a sql query is used to fetch all the persons whom with user is talked already. I need the id of the user from ...
0
votes
1answer
11 views

Replace single value in a column having comma separated values in mysql database

I need to replace the value "15" to "00" in product id column. Values in product id column is csv and only value 15 should be replaced ignoring 115 or 155. Below is the example table: id product ...
1
vote
1answer
37 views

How to convert this to a nice Eloquent query

How to query with Eloquent, all users without a certain type of certificate? Laravel 4 I've got 2 tables:(relations are set up correctly) users table: ->id ->name certificats table: ...
0
votes
1answer
12 views

Ruby on Rails optimalization of some code

I have some simple code that uses the minmax algoritm to locate birds. Everything works but I find my programming not good and I believe there is a better solution. I'm not that experienced in RoR but ...
0
votes
1answer
28 views

Mysql facebook style message join 3 tables

//USER TABLE user_id name 1 ben 2 alex 3 john //CONVERSION TABLE c_id user_one user_2 1 2(alex) 1(ben) 2 2(alex) 3(john) 3 1(ben) 3(john) ...
0
votes
2answers
17 views

Fill mysql column if two tables has the same value

I have two mysql tables, both has 3 columns, the first table third column is empty, the second table third column has data. Table 1 ---------|------------|---------| codprc | numideent | Empty ...
1
vote
1answer
17 views

Correct database implementation of groups like Google's circles

create table USERS ( PK_USER int not null auto_increment primary key, EMAIL varchar(100) not null, PASSWORD char(40) not null ); create table CIRCLES ( PK_CIRCLE int not ...
0
votes
0answers
30 views

Getting result starting from 15 minutes interval

Hello I have an SQL problem, I am getting the result but what I wanted is to get the starting 15 mins as well. Here's my current query: SELECT CONCAT(CAST(DATE_FORMAT(date_added, '%h') AS CHAR(2)), ...
0
votes
3answers
31 views

MySQL user with limited admin permission

I would like to create a MySQL user that can create new databases and manage only them (create/drop tables,) without the possibility of managing other schemas. Is that possible? What permission does ...
0
votes
2answers
41 views

detect change in column value?

This is how my table looks page time x 0 x 1 x 2 y 0 y 1 x 0 x 1 x 2 x 3 z 0 z 1 z 2 z 3 I am plotting a graph based on values of ...
0
votes
0answers
8 views

getting Object has no method 'getTime' while generating graph using googleGraphs

I am trying to generate graph using google graphs. I want to display the data monthwise. but for graph i am getting Object July has no method 'getTime' Here is my main page where i am displaying ...
-1
votes
0answers
24 views

PDO Dynamically Prepared Statement Always Returns Empty Array

The read method below doesn't seem to work. I tried several different things and none of them worked. No exceptions have been thrown so in my debugging script, it just shows an empty array returned by ...
2
votes
4answers
17 views

Query to get unique (last in timeline) connection between 2 ids in a table

I have a table "messages" that you can see the following image: from this table my id as user is 2. Sometimes I am sender, sometimes I am receiver. I need a query that returns only the last message ...
0
votes
4answers
43 views

Getting a field having `text` type

Class Issue inherits from ActiveRecord (ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux], Rails 3.2.13). Within this class I attempt to perform the following select: results = ...
2
votes
2answers
38 views

Sub select or group by

Hello have users table, related many-to-many with another table. fiddle CREATE TABLE users ( id INT NOT NULL PRIMARY KEY, name varchar(50) ); ; CREATE TABLE items ( id INT NOT NULL ...
0
votes
1answer
16 views

Syntax error in mysql init file when trying to flush privileges

I'm following the directions for windows at http://dev.mysql.com/doc/refman/5.6/en/resetting-permissions.html I'm trying to reset the root password. So I created a text file called pwreset.txt and ...
0
votes
2answers
19 views

Can json transfer longblob in php?

I used mysql to store the picture and it is stored by longblob. Now I need use json the transfer the data of longblob. The json_endcode($data) return null. How to do it?
0
votes
0answers
7 views

data not inserted in table in magento custom module

I am creating a custom module, but it's not inserting data in table. While it's show "successful" message Here my observe.php code is: $write1 = ...
-1
votes
3answers
51 views

Include PHP variables on AJAX page for SQL connection?

I have one main file that is making a few ajax requests to update MySQL results, however the database it is connecting to changes based on a config in a subdirectory. ( /app/directory's index.php has ...
0
votes
1answer
31 views

SQL Query - Large Number of Joins -

I have a SQL query that I'm using to pull in data from different tables for part details and fitment data. Unfortunately, the way the tables are laid out requires a lot of JOINs it seems. I currently ...
0
votes
1answer
20 views

using a variable inside a trigger

I am testing out my trigger and it works well all except i can't seem my variables don't seem to work like they should. For instance DELIMITER // CREATE TRIGGER lestrigger AFTER INSERT ON ...
0
votes
2answers
26 views

Use array as table in MySql JOIN

I would like to use data from an array to add a column and make a join on a MySql table. Let's say, on one hand, we have an array ($relevance): $relevance = array( array('product_id' => 1, ...
0
votes
0answers
10 views

Cannot see MySQL database connection made inside Node JS Server using SHOW PROCESSLIST;

I am running a Node JS + Socket.io server which makes a database connection with MySQL Server. I have written the following code at the global level( i.e. not inside any of the functions ) // All ...
-4
votes
1answer
42 views

ordering results in MySQL [on hold]

I am having trouble with an SQL ORDER function. My product database has images and prices. What I want is to order my results like this is: All products that have an image displayed by their price ...
0
votes
7answers
27 views

How to insert data in two different tables of two different database in php

I have to insert data in two different database's table. I have created database1 and table1 for database1, also i have created database2 and table2 for database2. For inserting data i have written ...
0
votes
1answer
16 views

mysql on wamp server doesnt work

i have just installes wamp server 2.4 and almost everything is working good but every time i am trying to open a file with mysql code on it he just showing me a white page whith nothing on it. this is ...
2
votes
2answers
30 views

SQL - “merge” 3 tables with JOIN

I want to select users from a table depending from two relation tables The Structure: [user] uid | firstname | lastname | ... --------------------------------- 482 | USERa | USERa | ... 885 ...
-2
votes
1answer
58 views

Complex select query with grouping in MySQL [on hold]

I have such view in my database: person | group | transfer_date ------------------------------ 1 | 1 | 2010-06-01 1 | 2 | 2011-07-01 1 | 3 | 2012-06-15 2 | 1 | ...

1 2 3 4 5 3532