LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 33 of 106
0 votes
1 ans
3 views
Escaping single quote in PHP when inserting into MySQL

I have a perplexing issue that I can't seem to comprehend... I have two SQL statements: - The first enters information from a form into the database....

database Solved
SJ
asked 1 month ago by sjw
0 votes
1 ans
3 views
How do you uninstall MySQL from Mac OS X?

I accidentally installed the PowerPC version of MySQL on my Intel Mac in Snow Leopard, and it installed without a problem but of course doesn't run properly...

database Solved
JO
asked 1 month ago by Joseph Ravenwolfe
0 votes
1 ans
3 views
Check if MySQL table exists without using "select from" syntax?

Is there a way to check if a table exists *without* selecting and checking values from it? That is, I know I can go `SELECT testcol FROM testtable` and check...

database Solved
BE
asked 1 month ago by Ben
0 votes
1 ans
3 views
How to use MySQL DECIMAL?

I can't quite get a grasp of MySQL's DECIMAL. I need the row to be able to contain a number anywhere from 00.0001 to 99.9999. How would I structure it t...

database Solved
CH
asked 1 month ago by Charles Zink
0 votes
1 ans
3 views
How to properly create composite primary keys - MYSQL

Here is a gross oversimplification of an intense setup I am working with. `table_1` and `table_2` both have auto-increment surrogate primary keys as the ID. `in...

database Solved
FI
asked 1 month ago by filip
0 votes
1 ans
3 views
Detect if value is number in MySQL

Is there a way to detect if a value is a number in a MySQL query? Such as SELECT * FROM myTable WHERE isANumber(col1) = true

database Solved
UR
asked 1 month ago by Urbycoz
0 votes
1 ans
3 views
Return 0 if field is null in MySQL

In MySQL, is there a way to set the "total" fields to zero if they are NULL? Here is what I have: SELECT uo.order_id, uo.order_total, uo.ord...

database Solved
KE
asked 1 month ago by Kevin
0 votes
1 ans
3 views
How to post query parameters with Axios?

I am trying to post on an API with some query params. This is working on PostMan / Insomnia when I am trying to by passing mail and firstname as query paramete...

database Solved
GU
asked 1 month ago by GuillaumeRZ
0 votes
1 ans
3 views
Reset MySQL root password using ALTER USER statement after install on Mac

I recently installed MySQL and it seems I have to reset the password after install. It won't let me do anything else. Now I already reset the password th...

database Solved
DE
asked 1 month ago by dengar81
0 votes
1 ans
3 views
If table exists drop table then create it, if it does not exist just create it

I'm stumped, I don't know how to go about doing this. Basically I just want to create a table, but if it exists it needs to be dropped and re-created...

general-dev Solved
GE
asked 1 month ago by George
0 votes
1 ans
3 views
Datetime equal or greater than today in MySQL

What's the best way to do following: SELECT * FROM users WHERE created >= today; Note: created is a datetime field.

database Solved
N0
asked 1 month ago by n00b
0 votes
1 ans
3 views
Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

I am continuously receiving this error. I am using mySQL Workbench and from what I am finding is that root's schema privileges are null. There are no pri...

general-dev Solved
CH
asked 1 month ago by Chase
0 votes
1 ans
3 views
PHP PDO: charset, set names?

I had this previously in my normal mysql_* connection: mysql_set_charset("utf8",$link); mysql_query("SET NAMES 'UTF8'");...

php-dev Solved
KA
asked 1 month ago by Karem
0 votes
1 ans
3 views
MySQL select where column is not empty

In MySQL, can I select columns only where something exists? For example, I have the following query: select phone, phone2 from jewishyellow.user...

database Solved
MI
asked 1 month ago by mike
0 votes
1 ans
3 views
Using column alias in WHERE clause of MySQL query produces an error

The query I'm running is as follows, however I'm getting this error: > \#1054 - Unknown column 'guaranteed_postcode' in 'IN/ALL/ANY subq...

database Solved
JA
asked 1 month ago by James
0 votes
1 ans
3 views
WHERE vs HAVING

Why do you need to place columns you create yourself (for example `select 1 as "number"`) after `HAVING` and not `WHERE` in MySQL? And are there an...

general-dev Solved
BA
asked 1 month ago by baloo
0 votes
1 ans
3 views
Is the primary key automatically indexed in MySQL?

Do you need to explicitly create an index, or is it implicit when defining the primary key? Is the answer the same for MyISAM and InnoDB?

database Solved
AL
asked 1 month ago by Alex Miller
0 votes
1 ans
3 views
phpMyAdmin - Error > Incorrect format parameter?

I have a WordPress production website. I've exported the database by the following commands: `select database > export > custom > select all tab...

php-dev Solved
HE
asked 1 month ago by Henry
0 votes
1 ans
3 views
How to alter a column and change the default value?

I got the following error while trying to alter a column's data type and setting a new default value: ALTER TABLE foobar_data ALTER COLUMN col VARCHA...

general-dev Solved
QA
asked 1 month ago by qazwsx
0 votes
1 ans
3 views
Cannot delete or update a parent row: a foreign key constraint fails

When doing: DELETE FROM `jobs` WHERE `job_id` =1 LIMIT 1 It errors: #1451 - Cannot delete or update a parent row: a foreign key constraint fai...

database Solved
ST
asked 1 month ago by steven