LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 46 of 106
0 votes
1 ans
3 views
Get table column names in MySQL?

Is there a way to grab the columns name of a table in MySQL using PHP?

database Solved
AN
asked 1 month ago by An employee
0 votes
1 ans
3 views
MySQL: Get character-set of database or table or column?

What is the (default) charset for: - MySQL database - MySQL table - MySQL column

database Solved
AM
asked 1 month ago by Amandasaurus
0 votes
1 ans
3 views
How do I see all foreign keys to a table or column?

In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as [this Oracle questio...

database Solved
CH
asked 1 month ago by Christian Oudard
0 votes
1 ans
3 views
MySQL Query GROUP BY day / month / year

Is it possible to make a simple query to count how many records I have in a determined period of time like a year, month, or day, having a `TIMESTAMP` field, li...

database Solved
FE
asked 1 month ago by Fernando Barrocal
0 votes
1 ans
3 views
When to use single quotes, double quotes, and backticks in MySQL

I am trying to learn the best way to write queries. I also understand the importance of being consistent. Until now, I have randomly used single quotes, double...

database Solved
NA
asked 1 month ago by Nate
0 votes
1 ans
3 views
MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

I can't make a simple connection to the server for some reason. I install the newest MySQL Community 8.0 database along with Node.JS with default settings....

server-admin Solved
PI
asked 1 month ago by Pig
0 votes
1 ans
3 views
What is the best collation to use for MySQL with PHP?

Is there a collation type which is officially recommended by MySQL, for a general website where you aren't 100% sure of what will be entered? I understand t...

database Solved
DA
asked 1 month ago by Darryl Hein
0 votes
1 ans
3 views
SQL injection that gets around mysql_real_escape_string()

Is there an SQL injection possibility even when using `mysql_real_escape_string()` function? Consider this sample situation. SQL is constructed in PHP like t...

database Solved
RI
asked 1 month ago by Richard Knop
0 votes
1 ans
3 views
'IF' in 'SELECT' statement - choose output value based on column values

SELECT id, amount FROM report I need `amount` to be `amount` if `report.type='P'` and `-amount` if `report.type='N'`. How do I add this t...

general-dev Solved
MI
asked 1 month ago by Michael
0 votes
1 ans
3 views
Create new user in MySQL and give it full access to one database

I want to create a new user in MySQL and give it full access only to one database, say `dbTest` that I create with a command like `create database dbTest;`. Wha...

database Solved
JI
asked 1 month ago by jimgh
0 votes
1 ans
3 views
Find duplicate records in MySQL

I want to pull out duplicate records in a MySQL Database. This can be done with: SELECT address, count(id) as cnt FROM list GROUP BY address HAVING...

database Solved
CH
asked 1 month ago by Chris Bartow
0 votes
1 ans
3 views
MySQL: Grant **all** privileges on database

I've created database, for example 'mydb'. CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'myuser'@'...

database Solved
MA
asked 1 month ago by marioosh
0 votes
1 ans
3 views
Authentication plugin 'caching_sha2_password' cannot be loaded

I am connecting MySQL - 8.0 with MySQL Workbench and getting the below error: > Authentication plugin 'caching_sha2_password' cannot be loaded: &...

general-dev Solved
AM
asked 1 month ago by Aman Aggarwal
0 votes
1 ans
3 views
How do I change the data type for a column in MySQL?

I want to change the data type of multiple columns from float to int. What is the simplest way to do this? There is no data to worry about, yet.

database Solved
ER
asked 1 month ago by Eric Wilson
0 votes
1 ans
3 views
MySQL - UPDATE query based on SELECT Query

I need to check (from the same table) if there is an association between two events based on date-time. One set of data will contain the ending date-time of...

database Solved
JO
asked 1 month ago by John M
0 votes
1 ans
3 views
How do I restore a dump file from mysqldump?

I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine. I tried using MySQL Administrator, but I got the fo...

database Solved
ZA
asked 1 month ago by Zack Peterson
0 votes
1 ans
3 views
How to skip certain database tables with mysqldump?

Is there a way to restrict certain tables from the mysqldump command? For example, I'd use the following syntax to dump *only* `table1` and `table2`:...

database Solved
ZA
asked 1 month ago by Zac
0 votes
2 ans
3 views
Export schema without data

I'm using a MySql database with a Java program, now I want to give the program to somebody else. How to export the MySQL database structure without the d...

general-dev Solved
DA
asked 1 month ago by Darth Blue Ray
0 votes
1 ans
3 views
Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?

What are the differences between PRIMARY, UNIQUE, INDEX and FULLTEXT when creating MySQL tables? How would I use them?

database Solved
SA
asked 1 month ago by Sam
0 votes
1 ans
3 views
MySQL Error #1071 - Specified key was too long; max key length is 767 bytes

When I executed the following command: ALTER TABLE `mytable` ADD UNIQUE ( `column1` , `column2` ); I got this error message: #10...

database Solved
ST
asked 1 month ago by Steven