LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 98 of 106
0 votes
1 ans
3 views
How can 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 command line. I have a [Windows Server 2008][1]...

database Solved
JA
asked 1 month ago by Jaylen
0 votes
1 ans
3 views
How can I prevent SQL injection in PHP?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to [SQL injection][1], like in the following example:...

database Solved
AN
asked 1 month ago by Andrew G. Johnson
0 votes
1 ans
3 views
Why shouldn't I use mysql_* functions in PHP?

What are the technical reasons for why one shouldn't use `mysql_*` functions? (e.g. `mysql_query()`, `mysql_connect()` or `mysql_real_escape_string()`)?...

database Solved
MA
asked 1 month ago by Madara's Ghost
0 votes
1 ans
3 views
Installing specific package version with pip

I am trying to install version 1.2.2 of `MySQL_python`, using a fresh virtualenv created with the `--no-site-packages` option. The current version shown in PyPi...

general-dev Solved
JO
asked 1 month ago by Joe
0 votes
1 ans
3 views
SQL select only rows with max value on a column

I have this table for documents (simplified version here): | id | rev | content | |------|-------|-----------------------...

database Solved
MA
asked 1 month ago by Majid Fouladpour
0 votes
1 ans
3 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.

database Solved
HO
asked 1 month ago by homerun
0 votes
1 ans
3 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:** shopping fishing codi...

database Solved
DE
asked 1 month ago by Dean Rather
0 votes
1 ans
3 views
How can I output MySQL query results in CSV format?

Is there an easy way to run a MySQL query from the Linux command line and output the results in [CSV][1] format? Here's what I'm doing now: ```lan...

database Solved
MC
asked 1 month ago by MCS
0 votes
1 ans
3 views
How can I get a list of user accounts using the command line in MySQL?

I'm using the MySQL command-line utility and can navigate through a database. Now I need to see a list of user accounts. How can I do this? I'm using...

database Solved
BU
asked 1 month ago by burntsugar
0 votes
1 ans
3 views
Which MySQL data type to use for storing boolean values

Since MySQL doesn't seem to have any 'boolean' data type, which data type do you 'abuse' for storing true/false information in MySQL? Esp...

database Solved
BE
asked 1 month ago by Beat
0 votes
1 ans
3 views
UTF-8 all the way through

<!-- ***** IMPORTANT INFORMATION ABOUT THE QUESTION TITLE ***** There has been a lengthy discussion about this title at the URL below. Do not make any tit...

general-dev Solved
ME
asked 1 month ago by mercutio
0 votes
1 ans
3 views
Retrieving the last record in each group - MySQL

There is a table `messages` that contains data as shown below: Id Name Other_Columns ------------------------- 1 A A_data_1 2...

database Solved
VI
asked 1 month ago by Vijay Dev
0 votes
1 ans
3 views
What's the difference between utf8_general_ci and utf8_unicode_ci?

Between `utf8_general_ci` and `utf8_unicode_ci`, are there any differences in terms of performance?

general-dev Solved
KA
asked 1 month ago by KahWee Teng
0 votes
1 ans
3 views
MySQL error code: 1175 during UPDATE in MySQL Workbench

I want to update the column `visited` to give it the value 1. I tried this command in the SQL editor inside MySQL workbench: UPDATE tablename SET columnn...

database Solved
JU
asked 1 month ago by Jury A
0 votes
1 ans
3 views
How can I get the sizes of the tables of a MySQL database?

I can run this query to get the sizes of all tables in a MySQL database: show table status from myDatabaseName; I would like some help in understandin...

database Solved
JP
asked 1 month ago by JPashs
0 votes
1 ans
3 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. For example: ```sql INSERT INTO table_nam...

database Solved
KE
asked 1 month ago by Keshan
0 votes
1 ans
3 views
How do I rename a MySQL database (change schema name)?

How do I quickly rename a MySQL database (change its schema name)? Usually I just dump a database and re-import it with a new name. This is not an option for...

database Solved
DE
asked 1 month ago by deadprogrammer
0 votes
1 ans
3 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-query, and I hate it; I don't know why....

database Solved
YO
asked 1 month ago by Your Common Sense
0 votes
1 ans
3 views
INNER JOIN ON vs WHERE clause

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

general-dev Solved
JC
asked 1 month ago by JCCyC
0 votes
1 ans
3 views
How can I do 'insert if not exists' in MySQL?

I started by googling and found the article *[How to write INSERT if NOT EXISTS queries in standard SQL][1]* which talks about mutex tables. I have a table w...

database Solved
WA
asked 1 month ago by warren