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
0
votes
0answers
12 views

Checking if $_POST variable is set using mysql variable

I have a php file that is receiving some checkbox values from a form. Both the checkbox name and value are set up to match an Item_Name field in a mysql table. My current attempt is below: while($row ...
0
votes
0answers
12 views

Mysql query with subquerys for each column with different categories

Tables: [CATEGORY] idcategory (int), category (varchar) [THEMES] idtheme (int), idcategory (int), theme (varchar) n numbers of categories. For this example, lets say 6. Each categorie has 18 themes. ...
0
votes
1answer
15 views

Getting foreign key column values easily in PDO (JOIN on INSERT)

I have two tables, 'events' and 'activities', where events has a foreign key 'activity' which is the id of that activity. When I'm inserting into the database, the data I get from POST is the activity'...
-3
votes
0answers
6 views

Script & mysql game server [closed]

Is it possible that .lua script with mysql can be whitelisted for certain ip adresses? I have script which was working yesterday nothing changed and today it is not working no errors or anything like ...
0
votes
0answers
12 views

Adding time from different tables PHP/SQL [duplicate]

Is there a way to add time from different tables? Visit table ------------------------------------------ idvisit| starttime | endtime| servicename| ------------------------------------------ 1 | ...
1
vote
1answer
16 views

How do I reduce the number of characters in an input string/varchar in MySQL

I basically have two tables tbl_feedback and tbl_notification that both get values inserted in them through a stored procedure whenever a person submits a feedback. What I'm aiming for is getting a "...
0
votes
0answers
3 views

Error Module 'xmlrpc' already loaded when both IIS and Wamp are running

I have IIS and WAMP both install and I am in a situation where I would need both to run simultaneously. The problem is if they both run whenever I want to access a php application using IIS I am ...
0
votes
0answers
18 views

How to sort My/SQL data into groups on separate pages

So I've been reading and testing but no luck. What I'm trying to do is group my specific data from my database onto separate pages when a specific link is clicked. Here is my DB structure For ...
0
votes
0answers
11 views

Displaying data from MySql in certain html tables that have certain values [closed]

Okay so say I have 3 html tables Superadmin, Admin, Moderator. I then have a table in MySql that's structured like this [ id | name | rank | time online | last online ] How would I make the users ...
-2
votes
0answers
9 views

i need help every time i log in this problem encountered me , [duplicate]

Every timeI log in, this problem is encountered: Parse error: syntax error, unexpected 'mysql_connect' (T_STRING) in C:\xampp\htdocs\ins\include\database.php on line 2 I've tried this <?php ...
0
votes
0answers
14 views

login doesnt direct to the page

my registration page redirects to the user profile but when I login it doesn't and they direct to the same page. The registration is successful because I can see the user profile in my database. I am ...
0
votes
1answer
21 views

Filter With() in Query Scope

Controller $r = \App\User::whereIn('id', $user_ids)->withPosts($category_id)->get(); User model public function scopeWithPosts($query, $category_id) { return $query->with('...
0
votes
3answers
31 views

SQL Selecting count from join returning 0 instead of null result

I have a query that gets data and also joins another table (A) and counts the rows in that join table (B). However if the main table (A) is empty I want the query to return nothing. However it is ...
-1
votes
0answers
20 views

assertion errors [duplicate]

what is the correct syntax for the assertion in SQL? I tried: CREATE assertion sumLoanes CHECK( 100000 > = ALL ( SELECT SUM(loan.amount) FROM loan, borrower WHERE ...
-1
votes
0answers
12 views

Questions with syntax in queries? JDBC [duplicate]

I am writing a program in java that will use a mySQL database to support it. When I run it I get a syntax error near the '?' char and i don't know why. Here is my code: String sql = "SELECT ...
0
votes
0answers
6 views

MiniProfiler for AspNetCore MySql connection

In .Net framework I use MiniProfiler for MySql connection command logging. In my current AspNetCore solution MiniProfiler doesn't show sql commands as well. What MiniProfiler options I should be using ...
-1
votes
0answers
18 views

Trouble with password_verify() [duplicate]

I am trying to get my login page to work, but it is refusing to do so. I have researched this and am just not understanding how to get this to work. On my register page: <?php if(isset($_POST['...
0
votes
1answer
29 views

Insert tuple to SQL table using INSERT INTO using python

I have a list of tuple that contains three elements: tuple = [0] > ("Drake", "Five", "2000") I also have an SQL table ClassInformation that has three columns: name,favorite number,year born with ...
0
votes
0answers
17 views

SQLITE. Storing url of users photos in database, what kind of relation?

I created table users with some data (name, id, age, etc). Now I want to store links on photos of user. What kind of relation I must choose: one to many, or many to many? I don't know amount of users ...
1
vote
2answers
18 views

MySQL Sort users by highest total count from counts on multiple tables

Similar to stackoverflow, I have a database of users who vote, comment, and make other actions. I am trying to return a sorted result of the top 10 users who have made the most actions based on the ...
-1
votes
1answer
32 views

Fields Integer as String, how can do? Php

i need change all fields integer to string, how can do? i am using php, laravel, mysql. The reason is because i need to set the value from the database in input select, to that I am using angularjs,...
0
votes
1answer
36 views

Cannot change NULL to 0 (MySQL Query)

MySQL Server version: 5.7.25-28-log - Source distribution I get 131 rows when I run this in phpMyAdmin SELECT * FROM bookings WHERE newsletter = 0 I get 685 rows when I run this in phpMyAdmin ...
-1
votes
0answers
22 views

Issues with HTML Form and PHP on same page [duplicate]

I'm trying to create a HTML Form combined with PHP, that insert data from the HTML Form into my database. The PHP script is working properly, but I really want it to be displayed on the current page ...
0
votes
0answers
9 views

Installing MariaDB 10.4 on Centos 7

I am experiencing some trouble with installing MariaDB 10.4 on Centos 7. The official mariaDB guide says that a new repo file MariaDB.repo should created in /etc/yum.repos.d/ with the contents of: # ...
0
votes
0answers
14 views

Avoid several json.loads from MySQL database while Reading

I'm a newbie to programming in python and would like to set up a MySQL database with flask on pythonanywhere.com. I execute the Reading/Writing process from/to the database using Marshmallow-...
0
votes
1answer
31 views

MySQL SUMIFS with Dates

Having difficulty with a SUMIFS scenario on MySQL Here's my data: CREATE TABLE opportunities (close_date DATE NOT NULL, sale_amount DECIMAL NOT NULL); INSERT INTO opportunities VALUES ('20190101',...
-2
votes
0answers
29 views

PHP validation with matching passwords

After doing some research I can't find how to figure out the following issue. I am trying to have the php validate that all fields are being entered by the user and that both passwords are matching. ...
0
votes
2answers
20 views

Mariadb Won't Change CHARACTER_SET_RESULTS from latin1 to utf8

I'm using 5.5.64-MariaDB MariaDB Server. I cannot for the life of me change the character_set_results to utf8. I tried ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci; I also tried ...
0
votes
2answers
31 views

RowNum in Mysql, with group by (MySQL 5.x)

I would like to do a rownum in MySql but using the group by. So the rownum need to start again when de column city change. I tried that: > select city, category_name, sales, @row_number:=CASE ...
-1
votes
0answers
11 views

Some part of my inserted strings get missing after Inserting data into mysql data base using php [duplicate]

Am working picking up array of date and time and inserting it into my database as a varchar, but somehow some parts of the time string disappears take for instance I enter "12:30" as time what gets ...
0
votes
0answers
26 views

Single quotes create an issue on a new server ( mysql / php ) [closed]

I am a bit puzzled. I am moving to a new server and I noticed that the WHERE clause doesn't work if it has single quotes. As an example, on the old server (php 7.1) this works fine: WHERE count > '...
0
votes
0answers
7 views

if else use in hibernate query

Hi i am building an application where i write a my sql query in sql which is given below select sum(if(bt.type = 'Fancy' ,bt.pnl,0)) as fancypnl ,sum(if(bt.type = 'Match Odds' ,bt.pnl,0)) ...
0
votes
1answer
21 views

How to Preview Update Set Where Statement using MySQL

The query listed below works perfectly, but for the life of me I cannot figure out how to convert it to a SELECT statement and preview the results. I know how to do it when SET and WHERE are used, but ...
0
votes
2answers
26 views

How to find the widest range in rent prices? [closed]

I'm trying to find the widest range of rent prices from different buildings. Apartment table and data: CREATE TABLE apartment ( buildingid CHAR(3) NOT NULL, aptno CHAR(5) NOT ...
-2
votes
0answers
20 views

Can I calculate the time difference between start date/time and end date/time and create a countdown? [closed]

I'm trying to create an auction system, where user provides start "date/time" and end date/time, how do I calculate the time difference between the two using PHP to show how much time is left on that ...
-1
votes
1answer
42 views

Speed Up Query Retun time

I have an SQL query which is filtering table from multi criteria in each field. It is working but it is kinda slow. Can you please advise if there is a better way to achieve a result like this and ...
-1
votes
1answer
25 views

Laravel eloquent get most repeated 10 products

I have an export_invoices table which contain invoices. +----+----------------+ | id | title | +----+----------------+ | 1 | First Invoice | +----+----------------+ | 2 | Second Invoice | ...
-2
votes
0answers
9 views

Como Almacenar un audio a un servidor local, audio que recibe modulo esp32 a travez de un microfono isd1820? [closed]

tengo un modulo microfono(isd1820) que se activa cuando detecta un sensor ultrasonico a un objeto o persona, este modulo tiene la capacidad de almacenar audio durante 10 segundos maximo, pero mi meta ...
0
votes
0answers
15 views

.NET Entity Framework Scaffolding + MVC + MySQL DB

I created a Business layer with EF database first approach. I used a MySQL database. Context class and table classes were generated fine. So I created a default MVC project for my UI layer then I ...
0
votes
1answer
18 views

Use an input parameter as a keyword in a stored procedure

MySQL Workbench is hitting me with the following error The object's DDL statement contains syntax errors. You cannot modify this object until you fix the errors. as well as the hint "SELECT" ...
-1
votes
0answers
37 views

Delete data (mvc)

I am new to mvc. I want to do a delete activity for my website. In a table, there's rows of data and in each row of data there will have update and delete button to allow user to perform activity on ...
0
votes
0answers
12 views

Connection between php and mysql using mysqli [duplicate]

Hopes everyone is doing well, I'm learning PHP, and I came across a situation where I can't success with my first mysql/php connection using mysqli. I want to list everything I can do and the problem ...
0
votes
0answers
26 views

Docker Compose: connect a WordPress container to a MySQL container?

I have an already running MySQL container that I use for several other containers. Now I'm trying to connect a wordpress container to it but I'm getting: Error establishing a database connection ...
0
votes
0answers
11 views

Replicating MySql Database with Druid [closed]

I've been trying to understand Druid. My goal is to connect a database in mysql to Druid (having the same information in both databases), so when a new register is added to the mysql database, Druid ...
-1
votes
1answer
26 views

get values from multiple tables based on one foreign key

I have 4 tables, a,b,c,d where b,c, and d have a foreign key pointing to a's id. I want to create a query that grabs all data associated with this key from a,b,c and d. The catch is if b has an entry ...
1
vote
0answers
27 views

PHP MySQL two queries separated by semi-color not working (works in MySQL command-line) [duplicate]

I have a php page where I am trying to execute a constructed MySql query. Hwever, when run using mysqli in php, it comes back as having a syntax error. There was an error updating your schedule: ...
0
votes
0answers
14 views

Onedrive and MySql [closed]

How can I get data from excel sheet placed on oneDrive in MySQL or any other database?
-1
votes
2answers
29 views

how to read and change a mysql 5 field

I'm a noob with databases and mysql, I have a mysql database including this table: +----+------------+------------+----------+----------+ | id | day | start_hour | end_hour | prenoted | +----+-...
0
votes
0answers
21 views

Calculating Time Between Logins Per User

I have a table that contains a unique ID, start time, end time and user ID, we'll call this table User_Logged_In where the start time is when the user is logged in and the end time is when they are ...
-1
votes
1answer
22 views

Node.Js add record using sequelize/body parser and mysql

Given the following code, how can I use body-parser & sequelize to add a student to the database? The response body should be {"message": "created"}. Tried to following way but it's not working ...