Category "mysql"

mysql if exists return the record value instead of regular output

I want a select that if/exists it returns the 'link' value instead of regular output. so instead of '1' it returns the 'link' Is that possible? SELECT IF( E

How to use mysqli prepared statements?

I am trying out prepared statements, but the below code is not working. I am getting the error: Fatal error: Call to a member function execute() on a non-objec

Changes to /etc/phpmyadmin/config.inc.php do not have effect

I would like to configure PhpMyAdmin to access only one database through one user. I tried before to restrict access via .htaccess using this answer from 2013 b

My message got duplicated when reloading the page [duplicate]

I have a problem with my PHP and MySQL code. I was creating a private messaging system but unfortunately, each time I reload the page, the las

How to access query result with the selection as object name

I have made a query on a data and it returns a result: [ RowDataPacket { 'COUNT(t.id)': 2 } ] How can I access it like the count number? I have tried result.COU

How to sort one column and then another within it in SQL? [duplicate]

I have this table state num ------------------------- ca 20 ny 30 ca 50 ca 10 ny 70 ny 90 What I want is to p

Mysql: can't start mysqld "mysqld.service: control process exited, code=exited status=1"

I have installed a third party framework fate, and mysql has been installed inside this framework, at the following path: /data/projects/fate/common/mysql/mysql

mysql null value case when is null does not work

I have following query to handle null value and flag those based on two table join however c.pure_proc_flag is null then 0 else 1 does not provide the result

getting an error while fetching data from database (mysql). n="+".join(n) TypeError: can only join an iterable

conn = mysql.connector.connect(host="localhost", user="root", password="", database="Attendance") my_cursor = conn.cursor() my_curso

EAV model - How to restrict product properties?

I have the following structure of my database, implementing a simple EAV model (see pic): My product has a type, which through the junction table restricts pro

How do I connect to JawsDB (add-on) with a Github deployment (javascript program) on Heroku?

I have tried my best to debug this issue for the past few days with no luck. I am a beginner so there could totally be simple things I just didn't know. So I ha

how to get gat with start & lenght?

"SELECT * FROM `user` WHERE `id`=" . $adminID . " ORDER BY `name` ASC LIMIT " . $start . "," . $length try to get data but the response showing []

HOW TO GET QUERY IN SQL USING PHP IN SQL TIGGERING

This is my code my $sql variable didn't give query plese help me for this I try this but I couldn't please help me with that <?php $connect = mysqli_con

mySQL java union

i used this query java and mysql but its not work (if i send directly mysql console its work bun in java not work.) Here down is my code: PreparedStatement pst;

Alter table add column if not exists in MySql

I need to make an alter table via migration on a node:14 server with umzug. The code is : IF NOT EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_

How to load data of string of date in csv to mysql database?

Here is a glimpse of my .csv file: Name,Start Date,End Date,Budget Class 1,1/1/2020,31/1/2020,"USD10,000.00" Class 2,1/2/2020,28/2/2020,"USD14,000.00" The date

sqlalchemy return constant dict in select

I am using sqlalchemy with MySql. I need to return a dict in select. Adding that dict value to fetched data is not an option. Is there any way in sqlalchemy or

How to use like query on FullText Index Column

I have this user table structure. `users` ( `id` bigint(20), `balance` bigint(20), `current_parent` bigint(20), `parents` varchar(45

Are there concerns if we have a database with mix of character set and collations?

we are currently in the process of migrating latin1 databases to UTF8 in a MySQL Server. We are investigating what is the best approach and hopefully without an

Error: can not delete or update parent row

I'm trying to Delete all the records related to this supplier from all relevant tables for Supplier with supplierNum = S3. But when I try to delete, I get an er