MySQL is an open-source, relational database management system. If your issue relates to MySQLi, use the MySQLi tag instead.

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

0
votes
0answers
8 views

Export Mysql data to a customized XLS file using php

First of all, I do know the process of exporting MySQL data to excel file using php. But I have some specific requirement and I want to know if it can be done or not. I have already googled, but ...
0
votes
0answers
2 views

Having trouble connecting with jdbc to an Amazon RDS MySQL instance with SSL

I actually (finally) figured out the answer to this on my own, but I wanted to post somewhere in case someone else had the same issue... This is the error that I was getting when I tried to run our ...
0
votes
1answer
14 views

Can I sub query this or not?

I've been trying to get a query/subquery to work for some stats but have failed, so I started again from scratch. I can now get the results I want but it's still in two separate queries. I have little ...
0
votes
2answers
11 views

INSERT data into a table only if it matches a field in another table

I have data that i want to import into a mySql DB but only if there is a matching email address in table two. INSERT INTO table_1 VALUE data_1, email WHERE email *exists in table_2* I am not ...
0
votes
0answers
7 views

How can I copy an MySQL db schema from db1 to db2 without losing data?

I have a MySQL database in production (I'm gonna call it db1) with lots of data already. In dev, I made several changes to the structure of the database but kept the data (I'm gonna call this new one ...
0
votes
0answers
10 views

Inserting data from text files into pre-existing columns

I am trying to insert data from a text file (18.9GB large) that looks like this: as8dyta89sd6892yhgeui2eg asoidyaos8yd98t2y492g4n2 as8agfuigf98safg82b1hfdy They are all a length of 32 ...
0
votes
2answers
10 views

MySQL: how to select the Nth value of each group with GROUP BY

I want to select the 2nd response column value of each new_threads group, with a zero as the value if it is a group of 1 row. new_treads|response ------------------ 1 | 0 1 | ...
-1
votes
2answers
33 views

cannot select a row in mysql

EDIT1 : used double quotes and single quotes but I am getting same error. EDIT2 : same query is returning me result in mysql shell I am selecting a row from a table. if(!isset($_GET['title']) || ...
0
votes
0answers
13 views

Memory usage high on server compared to wamp

Lately my site (with 260000 posts, 12000 images, 2,360,987 mysql rows and 450.7 MiB size) is running slow and at times not loading for many mins I installed this Debug bar plugin ...
0
votes
0answers
8 views

how to insert multiple mysql records in nodejs

i want to insert multiple data to mysql using nodejs, i have to created a code its worked for single data insert (1 column), code is : var data = "how are you"; db.query('INSERT INTO message ...
0
votes
0answers
6 views

Navicat (MySQL) Character Encoding Error

I am using Navicat 11.0.8 and I am trying to insert values into a table using a query but when i try to insert the values with the query it works but the character encoding is messed up! As you can ...
0
votes
0answers
7 views

connecting android app to mysql trough web service using soap

i am creating an app which places the order. and i have created the web service which is using System; using System.Collections.Generic; using System.Linq; using System.Web; using ...
0
votes
0answers
5 views

Creating a PDF using jsp, html, and css

I am trying to get a PDF to be generated that will display information from a database that's already been created. I'll be using JSP, HTML, and CSS. The information will be coming from MySQL. Any ...
0
votes
1answer
16 views

How to display MySQL data based on a column field

I am trying to make an appointment maker for potential customers. The hours that are available will depend greatly on personal schedules, so I don't want a generic calendar type appointment maker. ...
-1
votes
0answers
30 views

Is there a library for a recommendation system? [on hold]

I have a site with a large amount of content. Many of the users like very specific pieces of the content. What I want to do is notice that user A mainly looks at videos with tags "soft drumming" ...
0
votes
0answers
14 views

PHP SQLSTATE[HY000] [1045] Access denied for user Laravel

I'm working on a project (PHP Laravel 4.2) using SVN with team, After I checked out the repository on my disk (local), and tried to open the link localhost/mylaravel, I got this error PDOException ...
-1
votes
0answers
34 views

PHP - How to assign array with key value pairs to regular array

I have an array of key value pairs. I'd like to assign it to a regular array. The array with key value pairs looks like this with a var_dump: array(1) { [0]=> string(2) "10" } As you can see, there ...
0
votes
0answers
9 views

Rails: does minitest use schema.rb to recreate the test schema?

I am trying to bring a legacy Rails system up more current standards but having problems getting the test database to reflect the state of schema.rb plus changes made via migrations. tl;dr Does ...
1
vote
1answer
13 views

How to update a model with more conditions than an ID in Laravel?

I'm new in Laravel 5.0 and I trying to find a user to update him but with some conditions like a status or a expiration date. When I use the find method just given the user id is OK to update cause i ...
0
votes
0answers
8 views

Skip Indexes for ActiveRecord Query

What is the best way to run an ActiveRecord query in Rails, skipping any indexes that would otherwise be used? I am using the mysql2 DB adapter. My motivation is a little complicated: I've created ...
0
votes
1answer
9 views

Python 3.4 - How to transform a Pandas Data Panel (not frame) to a mySQL database?

I am trying to organize some financial data in a 'multidimensional' SQL database so that I can, at a later stage, take slices as needed across time or asset (or attribute such as 'close_price'). ...
1
vote
2answers
18 views

mysql error: code 1005 cant create table erno 150

I have been looking around online, erno 150 seems to be a common problem, but i am struggling with this code, any help? create table players ( email varchar(30) not null, playerpassword varchar(30), ...
0
votes
0answers
17 views

Symfony 2 - Multiple entities with one form

I've got the following tables with relationships: UserAddress table (Holds basic information for the address) UserAddressFields table (Holds the value for each field associated to an address) ...
0
votes
3answers
26 views

MySQL returns 2 values for every field requested [duplicate]

When doing a query() with a select statement the results contain two entries for field. $sql = "select first_name, last_name from users"; $rslt = $conn->query($sql); in the example above, the ...
0
votes
0answers
15 views

Text collaboration system using php mysql and html

I am trying to create a parent child text collaboration system and the parent text can have more than one child. for instance : text 1 can be edited and have edit two and text 1 can be edited again ...
3
votes
0answers
27 views

PHP PDO file upload and save to MySQL database results in obscure file breakage

After a lot of testing I have realised something is going wrong with my file upload process, and the resulting file(s) become mangled despite displaying the correct file details - size, name, mime ...
0
votes
1answer
12 views

Error adding line in mysql with correct syntax

I've looked at several answers already but none are solving my problem. I want to insert several lines into my table and am using the following code: INSERT INTO teams (id,'name','password') ...
0
votes
1answer
5 views

Create migration in Laravel with and without prefix

I need to create a database that has ALMOST all tables with a prefix, but some tables can't have it (legacy tables used in other softwares). So, let's say I have 3 tables: user group person user ...
0
votes
1answer
15 views

Php/Mysql: Database class and dependency injection

I'm trying to adopt dependency injection pattern to a mid-scale project that I have been working on. Most of my classes interact with database on some level and instead of instantiating a pdo object ...
0
votes
1answer
18 views

Query is not joining correctly, how do I fix it?

I have a large query that is structured like this: There are a bunch of tables the main table LT_CHC_TOURS_RSV_CS has a t_dt column. There is LTR_CHC_TOURS_RSV_PRICE that has a season value ...
0
votes
3answers
17 views

Exclude duplicate values in one table and return the remaining

I have a table like so: table: album_image(album_id, image_id) album_id image_id ---------------------------- 87 2326 87 2325 86 2325 85 5689 89 56 ...
0
votes
2answers
25 views

Determine if month of date falls on a quarter of date

I need to write some SQL that will determine if the current month is based on a quarter from a specified date. If I give it '2015-04-09', the function should determine if the month is equal to 1, 4, ...
0
votes
1answer
49 views

Limit rows in SQL for each group with Joins

I am trying to limit the rows for each group of an output. What is the way to do it. Explaining the case below: Table1: Customer_Details Customer ID Vandeur pid_01 Vandeur ...
2
votes
2answers
21 views

Execute query in python

I have a simple table ****************** MId | Title 1 | pqr 2 | abc ****************** now the code which i have written to append data to table is import MySQLdb db = ...
0
votes
3answers
26 views

Is this a t sql stored proceedure

I want to execute this from within Excel (SQL query window) where I would normally only execute the select statement. Should I make it into a stored proceedure and then execute tat from within Excel? ...
1
vote
2answers
13 views

MySQL 5.5 Alter Table TimeStamp default to Current Value, but it's being set to 0 instead

I am trying to add a last_updated column to a table w/ preexisting data in it. After I execute the ALTER TABLE statement, I expect for the last_updated column for all existing data to be set to the ...
1
vote
0answers
32 views

How to use .php file code to create sql table with foreign key and insert into PhpMyAdmin database?

So I've tried many different ways to create table with a foreign key and trying to insert into phpMyAdmin database. However, it just not working as I was expected. I've also tried to search related ...
0
votes
2answers
23 views

How to store an image from memory in MySQL

I'm trying to upload an image, change its size and then write the result to a MySQL database. Basic code: // load original image $image = imagecreatefromjpeg($file); // load original image ...
0
votes
1answer
21 views

How to display all the columns inside a table once at least one similarity has been found between 2 database?

Database_name1(Criteria) -> table_name(tenantCriteria) and inside I have the following columns -username -firsrent -occupation -age -tenantgender -income -history -address -tenantsmk -tenantpet ...
0
votes
0answers
17 views

Internal server error while executing insert query in laravel

So, I have just started out with Laravel. I am trying to create a create task api, where I save the data to the database. This is my routes.php Route::any('/createTicket', ...
1
vote
1answer
14 views

bind_param not working (on a non-object) mysqli prepared statement

I have read about 15 posts on here so far regarding issues like this none of which have been able to help me. I have the following code: $stmt3 = $mysqli->prepare("SELECT cc.name, cc.company, ...
1
vote
2answers
22 views

CodeIgniter Check if database is wrong

I'm working on a small application that connects to a database and retrieves data from tables. But I need to display to the caller that I wasn't able to connect to the specified host. How can I ...
0
votes
0answers
10 views

mySql normal form and saving fields

I need to insert into my database some composite informations: Name, Section, Room I want to clarify that: 1) I get these informations from a unique field and I'll use them only togheter; 2) The ...
0
votes
2answers
14 views

How to run script from within Mysql workbench?

I have a SQL script to distribute to others to run from a MySQL IDE, not from a MySQL command prompt. I want the user to load the script into a window of workbench (or another IDE like sqlyog) and ...
0
votes
5answers
34 views

DISTINCT * is not withdrawing the duplicity (MYSQL)

i already done everything to remove this duplicity on the database On selecting a checkbox on the sectio "Bairros" i utilized as Array for($m=0; $m<count($_POST["bairros"]); $m++){// LOOP 1 ...
-1
votes
1answer
18 views

html textbox posted to php create table columns

I am new to php and trying to learn. This example is not going live! I have a html textbox and posted to php. I am trying to break the string up using the explode function and want to add this ...
1
vote
0answers
17 views

Is Model.update a promise in Sails.js?

I'm currently working on a Sails.js app, and in a model function, I need to execute some queries in order. I'm using the default promises in waterline, but it's not working with the following code: ...
0
votes
1answer
20 views

Combine sub-arrays of an array that have the same key

I'm trying to populate an array of array where room_id should be combined in one sub-array instead of separated like they currently are. Here is my code: $query = "SELECT res_id, room_id, guest_id, ...
0
votes
0answers
10 views

Getting / adding eloquent models to cache

I've recently started to dig into Laravel 5 and I'm really "digging" it. (heh, heh, get it? ... Sorry.) Anyways. In my code, I noticed that, with relationships, eloquent does a TON of queries to ...
1
vote
1answer
13 views

Error 1062. Duplicate entry in mysql

I have a mysql table whose schema in which column 1 is primary key. i have a tsv file which I need to insert in this table. Now, the tsv has repetition of primary key hence when i try to insert it in ...