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 (4) | mysql jobs

0
votes
0answers
14 views

PHP/mysql fetch array

I am newbie about php. I wanted to create a new record in other table but just only one new variable comes in. Don't know how to do it, tried myself. That's what I got. $user_id = ...
0
votes
0answers
12 views

how to execute update

Can someone help me here with my little Java/MySQL Database tool? Part of the code is as follows, but when clicking on the createCustomerButton the DBMS tells me, that my syntax is somehow wrong. ...
0
votes
0answers
2 views

Split Joomla Database result in 3 columns

I am trying to split the mysql query result using joomla sql syntax and stuck as to how I can split the same in three columns. my query for which I am getting the result in single column is like ...
0
votes
0answers
15 views

use session variable in sql SELECT statement

I have to write a polling system in php. On the first page I have to display five soccer teams and when I select specific team through radio button that value has to be passed in another php page, ...
0
votes
0answers
3 views

cakephp 2 fields linked to same table

I have 2 3 tables USERS [id, name, fname, username, password, email, role] STUDENTS[id, class] FEES [id, user_id, month,amount, user_id] First: I want to link users and students by ...
0
votes
0answers
17 views

Is this sort of a thing possible in mysql?

I have timestamps in the following format in a table time_stamp day_chan1 day_chan2 day_chan3 2014-06-03 00:01:00 0 0 0 2014-06-03 00:02:00 0 2 1 2014-06-03 ...
0
votes
0answers
11 views

Zyxel NSA310 PHP

I've got a problem with installing PHP on my Zyxel NSA 310. I installed PHP plugin and I can access my phpMyAdmin for editing mysql database, but I don't know how to execute my PHP script. Where ...
1
vote
0answers
3 views

MySql Murach's Chapter 12 - Need AS to change depending on if two columns are equal.

I am working in Murach's MySql in Chapter 12. What I need to do is this: *Create a view named customer_addresses that shows the shipping and billing addresses for each customer. This view should ...
1
vote
1answer
15 views

Faster way to get number of results with a limit of first 1000 records?

In search pages, users have access to first 1000 results. Currently I use following SELECT COUNT(*) as count FROM (SELECT * FROM jobs WHERE MATCH (title, company, state, city) AGAINST ('senior ...
1
vote
2answers
11 views

How to to join a table onto itself, grouping the field being joined on?

I have a table that creates a record each time a post is created and another table that creates a record each time a post is favorited. CREATE TABLE `posts` ( `post_id` bigint(20) NOT NULL ...
1
vote
2answers
22 views

How can I use more than ONE vanity URL?

So I already have a vanity URL on my site for average users profiles... basecentre.co.uk/user1 this redirects users to basecentre.co.uk/userprofile.php?username=user1 using the code below... ...
1
vote
0answers
11 views

Searching for two or more tags when using join statement and tag map

I am having problems with my tag system. I have one table called ads one table called tags and another called tags_map where it links the tags to an ad listing. The problem am having is when I am ...
1
vote
1answer
12 views

Convert columns into rows with inner join in mysql

Please take a look at this fiddle. I'm working on a search filter select box and I want to insert the field names of a table as rows. Here's the table schemea: CREATE TABLE general (`ID` int, ...
0
votes
1answer
11 views

MySQL and InnoDB - UPDATE with WHERE on non unique index - how are rows encountered?

How are the rules in context of table row encountering when UPDATE with WHERE is performed on non-unique indexed column ? I have a test table with col column as non-unique index: id | col ...
1
vote
0answers
8 views

Save buttons missing in django admin

I have 2 simple models: class Doll(models.Model): name = models.CharField(max_length=32) doll_type = models.CharField(max_length=16, choices=DOLL_TYPE_CHOICES) mark = ...
0
votes
2answers
10 views

MySQL how to cascade on delete without foreign key

Alright so first let me introduce my schema. table: users Field | Type | Key | NN | AI --------------------------------------------- id | int(11) | PRIM | YES | YES ...
0
votes
0answers
5 views

checking GitLab installation : gitlab-shell self-check failed

I'm trying to install GitLab 7.1 on my Debian 7 running with Nginx 1.2 and MySQL 5.5 on my domain ''mydomain.com''. I followed these instructions. The web application GitLab is working fine and ...
0
votes
1answer
27 views

Query the database with OOP in PHP

I am new to OOP in PHP and i am trying to create a class, and then query the database. ATM the code looks like this and i am stuck in the query part. The query is ok, but it should use the class ...
-5
votes
3answers
36 views

I don't get PhpMyAdmin

Can somebody please explain me how I can add records in a PhpMyAdmin table and recieve data from a PhpMyAdmin table in a html file? I did some research and I really don't get it (how the connection is ...
0
votes
0answers
13 views

Sort users by similarity in MySQL

I have a list of items, a list of users and a list of votes each user has given to items. Not each user has voted on each item and a vote can be 1 or -1. Given a user, is it possible to sort users ...
3
votes
2answers
64 views

How to generate 1000000 rows with random data?

Background Im working on some kind of data logger. I want to try how much storage space I need for 1000000 (1M) rows and how Raspberry Pi deals with such big table. I want to run some queries with ...
2
votes
2answers
21 views

MySql Query - Joining

I have 2 tables: articles id int auto_increment title VARCHAR desc VARCHAR etc tags id int auto_increment articleId int tag Varchar The idea is that articles have multiple tags. I want to select ...
0
votes
1answer
14 views

Python MySQLdb - do I have to close cursors and connections?

Im Python newbie. I wrote simple script which runs every minute on my Raspberry Pi and it logs some data to MySQL 5.5 database. Script looks like this: #!/usr/bin/python import MySQLdb as mdb from ...
-1
votes
1answer
20 views

Display last post, PHP

So I finished a script to post a user's alliance news. They can keep posting new messages, but I'd like to find a way that it always displays the newest one on the main page of the alliance. This is ...
-2
votes
0answers
14 views

Searching and inserting in Database

I am writing this python script to search for a string in a file and once that string is encountered in that file it should be able to insert a numerical value against it in a mysql db like suppose a ...
0
votes
1answer
23 views

MSQL: Join not working

Im asking this question again, because my last one was marked as duplicate, and i was advised to use FULL OUTER JOIN, which is not possible in MYSQL! I'm having a table user ID | USERNAME | NAME | ...
0
votes
1answer
15 views

How to avoid multiple JOINS on the same table?

Two tables exist, for example: GROUPS id team1_id team2_id 1 1 2 2 3 1 TEAMS id name 1 aaa 2 bbb 3 ccc I need to obtain the team names in the group. So, the query looks ...
0
votes
0answers
10 views

Sorting hierarchical data by most recent using closure table

I'm trying to implement a comment system using PHP and mysql; I have a table wich contains comments data (Comment_ID, Post_ID, Author_ID, text, Creation_date etc...) and a closure table with Ancestor, ...
0
votes
1answer
23 views

Loop through mysql table to find a missing day in the table

I am uploading csv files into a mysql table. time_stamp,"Phase 1","Phase 2","Phase 3",Total 2014-07-09 07:59:21,8345,8665,5461,22471 2014-07-09 08:59:21,8345,8665,5461,22471 2014-07-10 ...
0
votes
0answers
11 views

Is foreign key still meaningful if soft deletion is used? Assuming “ON UPDATE” is never needed

My application uses soft deletion that marks a row as removed by setting a timestamp column (I am aware of disadvantages of soft deletion, but I still decide to use it for some reason). Now I am ...
0
votes
1answer
21 views

nodejs How to execute a mysql query with 2 statements

I'd like to execute 2 mysql statements with one query in node js. However this fails with the error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to ...
0
votes
3answers
23 views

trying to get a variable from one page to repopulate it on another

Im using a dropdown box on page one that should pass the vairable to the linked page and on the second use that variable"$id" on the second in mysql query. first page code to select who to look up ...
0
votes
1answer
9 views

Get cardinality possibilities from index in mysql

I have a table in which a field is of variable length of specific words, and over a few thousand rows this field/index has a cardinality of about 200. I would like to get access to that cardinality ...
0
votes
0answers
13 views

InnoDB Isolation Level for single SELECT query

I know that every single query sent to MySQL (with InnoDB as engine) is made as a separate transaction. However my concerns is about the default isolation level (Repeatable Read). My question is: as ...
2
votes
1answer
13 views

stored procedure CONCAT() Error Code 1054, Unknown column

thanks in advance for you help. you guys are awesome. having trouble with CONCAT() inside a stored procedure. trying to create an INSERT INTO with variables. ERROR CODE 1054, Unknown column 'Milk' ...
0
votes
0answers
24 views

storing some values from a php-array into mysaql-db fails

i want to store some data that i have gained from a request at the planetfile of openstreetmap: so i have set up a database on my opensuse 13.1 test CREATE TABLE `pois` ( `id` bigint(20) unsigned ...
1
vote
1answer
38 views

Php Mysql sum total with select all rows returned

How can i query and return all the rows but with "SUM" added to my query? Here is my sample query: select SUM(amount) as total, user_id, username, from table where user_cat = '1'; if I remove ...
0
votes
1answer
19 views

PHP Script - Activity Description not reflecting record values

I had a need for a system that could track billable tasks for tickets that we processed. I have a script that is almost complete, but I cannot seem to figure out why the tickets_tasks_activity field ...
-2
votes
0answers
19 views

inserting data in one table and comparing it with another table in mysql

I have one table named A that has all the information of all the employees. I have created a registration page in JFrame. I want that if a user enters his details in that registration page, the ...
0
votes
5answers
38 views

Unable to delete from multiple tables

I'm trying to delete all records of a person in a website that I created through an admin account. The query is as followed: DELETE FROM users u, user_address ua, pending_order po, product_catalogue ...
0
votes
3answers
28 views

How to create a table in database using jquery

I have a button that when pressed will create a table in the database. I tried this index.html <button id="loadButton" type="button" class="btn btn-success" style="margin-top:5px;">Carregar ...
-1
votes
5answers
30 views

Using ternary operator inside MYSQL query in PHP syntax error

I have this simple PHP/MYSQL prepare statement: $DBH->prepare("SELECT * FROM books '.($_POST['author'] ? '' : '').' WHERE id = '1'"); The ternary operator above leads to a syntax ...
0
votes
2answers
15 views

Store and Query Time in MySQL

I am designing a database for userEvent data. I will be storing their running event and time. So for example 1500 meters in 5:00 or 10,000 meters in 30:20. The database will be recieving the user ...
0
votes
0answers
12 views

mysql row as variable

How do I write a mysql query Where the WHERE clause is equal to the ID field of the selected option values row ? I know this won't work, but I hope you understand what I'm trying to do: ...
0
votes
1answer
23 views

Adding Columns Dynamically to a MySQL Database using PHP

Hello & good afternoon, I am developing an online product returns form which depending on the number of products the customer wants to return asks for the serial number of each one then i want to ...
0
votes
1answer
12 views

Trouble counting rows with specific value - Doctrine, Symfony2, mysql

I'm working on querying my mysql database via doctrine in a symfony2 app. I have a basic table set up that includes an id number ('id'), name ('name'), and a last column for if the person has been ...
-4
votes
0answers
14 views

php CountDown Time 48 Hr. after INSERT mysql success and UPDATE mysql Again When Finished CountDown?

php CountDown Time 48 Hr. after INSERT mysql success and UPDATE mysql Again When Finished CountDown ? my main idea , when user press button INSERT data inti mysql after INSERT success , Strat ...
0
votes
1answer
9 views

fatal error C1083: Cannot open include file: 'mysql_connection.h' in release mode

Everything goes fine when it is in the debug mode, but when I switch to the release mode and run it, the error came out. Please help.
0
votes
2answers
35 views

SQL syntax error or server error?

Hey guys I am new to the whole database scene and trying to perform a relatively simple task but apparently I am doing something wrong. Every time I try to execute this statement I get a 1064 error ...
-2
votes
0answers
20 views

How to scale MySQL database? [on hold]

We are a web startup, We are getting a lot of requests recently and the response time is taking too much time, sometimes, 2-4 seconds for a single page. I just wanted to know if there any way to ...