Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [mysql]

MySQL is a free, open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). DO NOT USE this tag for other DBs such as SQL Server, SQLite etc. Those are different DBs which all use their own dialects of SQL to manage the data.

Filter by
Sorted by
Tagged with
-1
votes
2answers
19 views

PHP Logic for reward when POST reach 1000 Likes

I have one android application which use PHP and MySQL as backend. I want give some extra points when user's post get 1000, 2000, 3000 likes and so on. I am storing total likes in table called ...
0
votes
0answers
7 views

Rookie help - Making localhost server be a online server

Okay, I need a little bit of guidance. I am really new to all of this... This is for a homework assignment, but I have a site I am hosting on my local network with WAMP/phpmyadmin. How exactly do I ...
0
votes
2answers
19 views

how to fetch all the houskeepers name & the sum of 1bed,2 bed & total_work_time at once from the selected date?

there are 2 table tbl_hk and tbl_hk_work: tbl_hk:hk_id(pk), hk_name tbl_hk_work:hk_work_id, hk_id(fk), hk_work_date, hk_work_1bed, hk_work_2bed, hk_work_time Now the problem is I want to fetch all ...
-2
votes
0answers
7 views

Parse error: syntax error, unexpected '$username' (T_VARIABLE) in C:\xampp\htdocs\WEB1\include\database.php on line 3 [duplicate]

this is my configuration in database.php btw i use XAMPP for the server, thanks before. <?php $servername ="localhost" $username ="root" $password ="" $...
0
votes
1answer
22 views

How can I ensure that a lost update does not occur in my code?

I just want to simply know what code to write in my procedure to ensure that no lost updates can occur. Here's my code: CREATE OR REPLACE PROCEDURE UpdBal (vcust3 number, vcust7 number) AS BEGIN ...
0
votes
0answers
13 views

MySQL Error: ReverseEngineerTable: Skipping Index table.column on a LONGCHAR column

I'm migrating my Access database tables to be hosted online with MySQL. When I use MySQL Workbench to migrate it over, it throws a number of these errors during the reverse engineer source phase: ...
0
votes
3answers
26 views

Group by date and take the last one

This is my table : What I'm trying to do, is to take the last disponibility of a user, by caserne. Example, I should have this result : id id_user id_caserne id_dispo created_at 31 21 ...
-1
votes
0answers
11 views

fetch all rows on multidimensional array database [duplicate]

i have a database like this budget | need | processorName | motherboardName | ramName low | office | AMD Touring | Compaq 354 | Touring 4x1Gb low | gaming | Intel Gaming | Kwak 447 ...
0
votes
2answers
20 views

How to update each row by it's own value encrypted

I'm trying to update every value of a column. I'm trying to apply encryption for an existing database $query = $this->db->query("select firstname from user"); foreach ($query->result_array(...
0
votes
0answers
12 views

Slow inserts to CloudSQL via SQL Alchemy in Python 3

I'm experiencing a weird issue, where I'm posting roughly 5k records to localshost MySQL db, then to CloudSQL instance. Localhost insert takes about 5 seconds, while CloudSQL takes ~5 minutes, and ...
0
votes
1answer
9 views

Update table from another table based on dynamic column reference in MySql 5.7

I have two tables NEW_TBL and CURRENT_TBL. The values in CURRENT_TBL need to be updated so they are equal to NEW_TBL. Both tables have a PK named tableId, but the columns in NEW_TBL will not always ...
0
votes
1answer
10 views

Querying across hierarchical tables SQL

I'm having issues querying a table with a subclass. To illustrate, if I had the following tables in a MySQL database userTable: id name gender_id 1 bob 1 .... genderTable: ...
-1
votes
0answers
13 views

PHP - Adding item from HTML form to favorite or saved list and retrieve back for a particular user

I'm creating a form that will allow users to read the contents, and then decide to add to favorite/saved list, where they can refer back to read quickly again while clicking on "My Favourites." and it ...
0
votes
1answer
21 views

PHP variable not taking the value of the database element value assigned to it

I fetched a MySQL result for a query using the MySQLi extension of PHP . The resulting table of the query is only one entry long <?php if(!empty($_POST["search"])) { $query = "SELECT * FROM ...
0
votes
0answers
7 views

Different result of checking if connection is open in pymysql

Somehow, I get different result when I check is connection is open. After running the program, in the middle of his execution, I kill connection on server. First piece of code print me True, second - ...
0
votes
1answer
15 views

How to collect only the latest entries from a table by user

I have a transaction table. I need to make a query that needs to pull the latest entries by client_id. 8 UK0619344 Mr Stephen Cutt XS1923339623 50000 25/10/2019 16:57 9 UK0619344 Mr ...
0
votes
0answers
12 views

MySQL startup ERROR! The server quit without updating PID file

I'm trying to start mysql in a Mac using sudo /usr/local/mysql/support-files/mysql.server start. I keep getting the following error - ERROR! The server quit without updating PID file (/usr/local/mysql/...
-3
votes
0answers
21 views

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, string given in C:\wamp\www\ReaTech\includes\function.php on line 32 [duplicate]

I'm new to programming, here's a code to create a user profile, I keep getting the errors "Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, string given in C:\wamp\www\ReaTech\...
1
vote
1answer
20 views

How to query through all varchar columns for a specific char [duplicate]

I have to search for the char ' - ' in all columns (and lines) of my table. Currently I have this: SELECT * FROM `my_table` WHERE ( SELECT C.COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS C ...
-2
votes
1answer
17 views

Why I get an error, I can’t understand. Chuvachki help. This is in MySQL workbench

REATE TABLE IF NOT EXISTS `Restorane`.`Menu` ( `idDishes` INT NOT NULL AUTO_INCREMENT, `Name_of_dish` VARCHAR(45) NOT NULL, `idIngredient_1` INT NOT NULL, `Ingredient_volume_1` VARCHAR(45) NOT ...
0
votes
2answers
18 views

Get all entry where term id equal Mysql query

I have 2 tables News +---------+---------------+---------------+--------------+--------+ | news_id | title | short | body | etc... | +---------+---------------+---------------...
0
votes
0answers
10 views

Creating a multithreaded scraper and keeping track of the progress

I created a file scraper that will go through CSV and Excel files and save each row into its appropriate columns in a MySQL DB. The functionality works but I wanted to know how I would go about ...
-1
votes
1answer
29 views

Request - migration to php 7

I have an old function: static public function Select($table, $terms) { if (trim($terms)=="") $request = "SELECT * FROM $table"; else $request = "SELECT * ...
0
votes
1answer
23 views

Convert VARBINARY to Base64 in MySQL

This seems like a basic scenario, but I can't find relevant info anywhere. I'm new to MySQL, coming from years of Microsoft SQL Server experience. In MySQL, how do you convert a BINARY or VARBINARY ...
1
vote
2answers
27 views

Calculate time difference between 2 (non consecutive) rows

I'm newbie in SQL and I'm trying to compare two hours and see the difference between rows in columns "diff plan" and "diff done". How can I achieve this? Thank you! :) date id ...
-1
votes
1answer
14 views

Selecting all including DATEDIFF() from two tables

I'm new to SQL functions and I have a question regarding datediff(). I have two tables with identical structure and I want to SELECT all entries from both of them including a DATEDIFF() in one query ...
-2
votes
0answers
15 views

Domain is currently unable to handle this request. HTTP ERROR 500 [duplicate]

I am getting is currently unable to handle this request. HTTP ERROR 500 error whenever I try to open my website. I have tried changing the name of the plugins folder but it still didn't work. I have ...
0
votes
4answers
32 views

Displaying Other values of the row after getting the max of a subquery [duplicate]

So I have is this query: select MAX(C.Sales) as 'NumOfSales' from (select COUNT(SalesOrderID) as 'Sales', TerritoryID from Sales.SalesOrderHeader group by TerritoryID) C right now it ...
-1
votes
2answers
19 views

How to get current user_id of logged in user

I just created a php file to update a field in mysql db, my update query is where i have an issue, i want to set 'user_id' to be the user_id of the current user that is logged in so the update will go ...
0
votes
0answers
18 views

Insert via SQLAlchemy – why does it start counting at 0 every time?

I have to insert a lot of text data to my database. My code reads the text data correctly. SQLAlchemy inserts the data to my database, but it starts every text at ID 0 – why? I use Python 3.7.4, ...
-2
votes
0answers
22 views

Auto update multiple rows in the table every minute [on hold]

I am developing stock related game. When I click start button stock prices updating every minute until click stop button. 16 stocks and 60 minutes game, total 960 prices are stored in another table ...
1
vote
1answer
24 views

i want to write code for check if data already exits then insert in diffirent table

I already write the code to check if table call hm2_history type = commission if yes then insert data into table call hm2_deposit, when i test echo was correct and show the resulte is Connected ...
0
votes
0answers
12 views

Is base64 BLOB less in size compared to base64 text in database? [duplicate]

My client sends an image to the server encoded in base64, and the server inserts the data into MYSQL table as a BLOB. My question is, should I decode the base64 image and then insert it into MYSQL as ...
1
vote
1answer
18 views

Reformat input DATE data

I have a rather large (over 200,000 records) file that I am inserting into a table with 59 columns. The data contains several DATETIME fields. The input dates are in the form '10/06/2019 10:45:58'. ...
-2
votes
0answers
13 views

Get thumbnail from product of external database

I'm trying to get the products from an external woocommerce, from another website, I get the products but I don't know how to get a thumbnail, here's my code so far $mydb = new wpdb( 'root', '', '...
0
votes
1answer
18 views

Order by the difference of two selects in mysqli

I have a table like this: groupX groupY quantity A B 10 A C 2 C D 7 B A 13 C B 1 D B 9 So, the ...
-5
votes
0answers
18 views

Can not login admin when transfer live site on hosting to localhost with codeigniter

I just have a problem, my friends help and send me source codeigniter, that's running good hosting, now I setup and run in localhost, but it can not login and registrater account thanks
0
votes
1answer
23 views

MySQL: Using Union to split multiple Select queries into respective tables

I have the following tables: Product(maker, model, type) PC(model, speed, ram, hd, price) Laptop(model, speed, ram, hd, screen, price) Printer(model, color, type, price) I need to write a query ...
0
votes
1answer
19 views

how to select all repeated data in a table without giving any key?

I have a table that has thousands of data but with repeated ones. Now i want to select all of them automatically without giving any key. How can I do that please? EXAMPLE: |id|name |email| ---+----...
0
votes
1answer
18 views

ADOdb and Previewing Prepared Statements (PHP)

According to: https://adodb.org/dokuwiki/doku.php?id=v5:userguide:portable_sql#prepare_execute $stmt = $db->prepare("SELECT * FROM customers WHERE custid=? AND state=?"); $rs = $db->execute($...
0
votes
1answer
20 views

Is it possible to gather rows created during statement execution?

I'm looking for something that'll effectivley to this: ResultSet rs = con.prepareStatement("INSERT INTO Table (num1,num2,num3) VALUES (1,2,3)").execute(); Essentially setting data on the rows you've ...
0
votes
0answers
23 views

Mysql query return #1247 - Reference 'total_purchase_qty' not supported

I can't access alias name: Query Return #1247 - Reference 'total_purchase_qty' not supported (reference to group function) Previous i use SELECT sometime i face same problem sometime not face like ...
0
votes
0answers
14 views

Qt5, C++: QMYSQL driver not loaded

I am trying to connect to a database using MySQL server with Qt. It is not working and when I run the code, I get the error message below. "QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: ...
0
votes
0answers
5 views

Session Factory issue in hiernate

Session Factory error in hibernate: In hibernate I have created a class hibernate template in which I'm getting errors under session factory. how to resolve this problem? Iam using apache tomcat ...
-4
votes
0answers
31 views

Get a MySQL response when no rows were changed [on hold]

I am making a cancellation feature for a booking system and I want to return a message of "your reservation has been canceled" vs "error, please call us!" Here is my code: <?php include 'dbconfig....
-1
votes
1answer
39 views

query sorted by letter without like() - laravel

where is the mistake? I need it to be organized in alphabetical order, but it shows everything repeated, and I need the data to be shown under its letter, follows code: print dashboar code ...
0
votes
1answer
10 views

mysql syntax error code 1064 unsure of what to do

Below is my mysql code, i keep getting a syntax code for the last line, i have no idea what to do ive been trying all sorts of stuff the past 2 hours, anyone got any idea? CREATE TABLE audit ( ...
0
votes
0answers
15 views

Get the total of notif (comments unread)

I need your help for a mysql query. I have a system of support with "tickets". I want to show the total of notifications to the support agent if he have unread messages. The goal is to select only ...
0
votes
0answers
20 views

How i can echo enum value from mysql database?

I have a table "members" with column called "Type" and it is "enum" and the values are"member, mod, admin, dev". I want to know how i can echo the enum value that i set to member by $_SESSION['type'] ...
0
votes
0answers
12 views

I am using multiple databases in Spring Boot, but creating domains in primary Database

I am trying to connect with two databases in Spring Boot. But two domains are creating in the primary Database. I uploaded my code. If anyone knows. I am not getting any console errors.But two domains ...