Tag: mysql

59 votes
2 answers
3K views
Matching all values in IN clause

Is there a way to ensure all values in an IN clause are matched? Example: I can use IN as: IN (5,6,7,8). I

avatar
Solomon
0 1 0 9
asked 07 September, 2021
54 votes
4 answers
2.7K views
WooCommerce: Finding the products in database

I'm creating a website using WooCommerce and I want to restrict the available products to users depending

avatar
Scot
0 1 0 9
asked 07 September, 2021
57 votes
5 answers
465 views
Column count doesn't match value count at row 1

So I read the other posts but this question is unique. So this SQL dump file has this as the last entry. INSE

avatar
Keith
0 1 0 9
asked 07 September, 2021
56 votes
17 answers
1.2K views
Access denied for user 'root@localhost' (using password:NO)

I'm new to MySQL, I'm trying to run WordPress in my Windows desktop and it needs MySQL. I install e

avatar
Alba
0 1 0 9
asked 07 September, 2021
61 votes
14 answers
2.8K views
#1273 - Unknown collation: 'utf8mb4_unicode_ci' cPanel

I have a WordPress database on my local machine that I want to transfer to a hosted phpMyAdmin on cPanel. Howe

avatar
Nidia
0 1 0 9
asked 07 September, 2021
52 votes
8 answers
3.1K views
Table is marked as crashed and should be repaired

I am getting this error in wordpress phpMyadmin #145 - Table './DB_NAME/wp_posts' is marked as cras

avatar
Brianne
0 1 0 9
asked 07 September, 2021
49 votes
15 answers
2.2K views
#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

I have a WordPress website on my local WAMP server. But when I upload its database to live server, I get error

avatar
Sachiko
0 1 0 9
asked 07 September, 2021
66 votes
8 answers
775 views
MySQL vs MongoDB 1000 reads

I have been very excited about MongoDb and have been testing it lately. I had a table called posts in MySQL wi

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
1.2K views
How can I SELECT rows with MAX(Column value), PARTITION by another column in MYSQL?

My table is: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/

avatar
Lawanda
0 1 0 9
asked 07 September, 2021
48 votes
20 answers
614 views
Join vs. sub-query

I am an old-school MySQL user and have always preferred JOIN over sub-query. But nowadays everyone uses sub-qu

avatar
Charis
0 1 0 9
asked 07 September, 2021
54 votes
11 answers
1.1K views
Insert into a MySQL table or update if exists

I want to add a row to a database table, but if a row exists with the same unique key I want to update the row

avatar
Rudy
0 1 0 9
asked 07 September, 2021
54 votes
12 answers
2.7K views
INNER JOIN ON vs WHERE clause

For simplicity, assume all relevant fields are NOT NULL. You can do: SELECT table1.this, table2.that, ta

avatar
Percy
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
1.2K views
Retrieving the last record in each group - MySQL

There is a table messages that contains data as shown below: Id Name Other_Columns ----------------------

avatar
Janella
0 1 0 9
asked 07 September, 2021
52 votes
13 answers
2.5K views
Can I concatenate multiple MySQL rows into one field?

Using MySQL, I can do something like: SELECT hobbies FROM peoples_hobbies WHERE person_id = 5; My Output:

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
55 votes
24 answers
1.9K views
How to reset AUTO_INCREMENT in MySQL

How can I reset the AUTO_INCREMENT of a field? I want it to start counting from 1 again.

avatar
Scot
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
1.3K views
How do I import an SQL file using the command line in MySQL?

I have a .sql file with an export from phpMyAdmin. I want to import it into a different server using the comma

avatar
Sydney
0 1 0 9
asked 07 September, 2021
58 votes
7 answers
2.3K views
Codeigniter - multiple database connections

I have to retrieve a MySQL database information from master database and then connect to that database, and fe

avatar
Louetta
0 1 0 9
asked 07 September, 2021
53 votes
3 answers
1.2K views
Increment field of mysql database using codeigniter's active record syntax

I have the following php-codeigniter script which attempts to increment a field of a record using active-recor

avatar
Shanita
0 1 0 9
asked 07 September, 2021
52 votes
10 answers
1.8K views
How to select rows where column value IS NOT NULL using CodeIgniter's ActiveRecord?

I'm using CodeIgniter's Active Record class to query the MySQL database. I need to select the rows i

avatar
Arline
0 1 0 9
asked 07 September, 2021
61 votes
11 answers
579 views
Inserting NOW() into Database with CodeIgniter's Active Record

I want to insert current time in database using mySQL function NOW() in Codeigniter's active record. The

avatar
Corrin
0 1 0 9
asked 07 September, 2021