LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

2110 solutions found in plugin-api

Page 28 of 106
0 votes
2 ans
25 views
Set NOW() as Default Value for datetime datatype?

I have two columns in table users namely `registerDate and lastVisitDate` which consist of datetime data type. I would like to do the following. 1. Set regi...

general-dev Solved
IB
asked 5 months ago by Ibrahim Azhar Armar
0 votes
3 ans
26 views
How to do a batch insert in MySQL

I have 1-many number of records that need to be entered into a table. What is the best way to do this in a query? Should I just make a loop and insert one rec...

database Solved
GE
asked 5 months ago by Genadinik
0 votes
1 ans
28 views
Doctrine - How to print out the real sql, not just the prepared statement?

We're using Doctrine, a PHP ORM. I am creating a query like this: $q = Doctrine_Query::create()->select('id')->from('MyTable');...

database Solved
AM
asked 5 months ago by Amandasaurus
0 votes
1 ans
29 views
How do I install command line MySQL client on mac?

I want to install the MySQL client for the command line, not a GUI. I have searched over the web but only found instructions on installing the MySQL server.

database Solved
HC
asked 5 months ago by hch
0 votes
2 ans
31 views
Setting Django up to use MySQL

I want to move away from PHP a little and learn Python. In order to do web development with Python I'll need a framework to help with templating and other t...

database Solved
GR
asked 5 months ago by gregor
0 votes
2 ans
30 views
Add 2 hours to current time in MySQL?

Which is the valid syntax of this query in MySQL? SELECT * FROM courses WHERE (now() + 2 hours) > start_time *note: start_time is a field of course...

database Solved
EI
asked 5 months ago by Ei Maung
0 votes
3 ans
28 views
How do I turn off the mysql password validation?

It seems that I may have inadvertently loaded the password validation plugin in MySQL 5.7. This plugin seems to force all passwords to comply to certain rules....

database Solved
AL
asked 5 months ago by Alex Ryan
0 votes
2 ans
28 views
How to find the mysql data directory from command line in windows

In linux I could find the mysql installation directory with the command `which mysql`. But I could not find any in windows. I tried `echo %path%` and it resulte...

database Solved
PR
asked 5 months ago by Prabhu
0 votes
2 ans
33 views
Can't connect to local MySQL server through socket '/tmp/mysql.sock

When I attempted to connect to a local MySQL server during my test suite, it fails with the error: OperationalError: (2002, "Can't connect to l...

server-admin Solved
AL
asked 5 months ago by Alex Gaynor
0 votes
1 ans
27 views
MySQL date format DD/MM/YYYY select query?

I'm a bit confused on how to order by date formats. For the format `YYYY-MM-DD` you would do this: `...ORDER BY date DESC...` How would you order by...

database Solved
BA
asked 5 months ago by basickarl
0 votes
3 ans
32 views
"where 1=1" statement

> **Possible Duplicate:** > [Why would someone use WHERE 1=1 AND <conditions> in a SQL clause?](https://stackoverflow.com/questions/242822...

general-dev Solved
ME
asked 5 months ago by Mellon
0 votes
2 ans
28 views
Is there a naming convention for MySQL?

Here's how I do it: 1. Table names are lower case, use underscores to separate words, and are singular (e.g. `foo`, `foo_bar`, etc. 2. I generally (no...

database Solved
ST
asked 5 months ago by StackOverflowNewbie
0 votes
2 ans
26 views
MySQL Like multiple values

I have this MySQL query. I have database fields with this contents sports,shopping,pool,pc,games shopping,pool,pc,games sports,pub,swimmin...

database Solved
WE
asked 5 months ago by webmasters
0 votes
2 ans
31 views
Copy table without copying data

CREATE TABLE foo SELECT * FROM bar copies the table `foo` and duplicates it as a new table called `bar`. How can I copy the schema of `foo` to a new t...

general-dev Solved
MA
asked 5 months ago by Matthew
0 votes
3 ans
28 views
SQL - Update multiple records in one query

I have table - **config**. Schema: `config_name | config_value` And I would like to update multiple records in one query. I try like that: UPDATE c...

database Solved
US
asked 5 months ago by user3022527
0 votes
2 ans
34 views
LEFT JOIN only first row

I read many threads about getting only the first row of a left join, but, for some reason, this does not work for me. Here is my structure (simplified of cou...

general-dev Solved
KD
asked 5 months ago by KddC
0 votes
3 ans
30 views
Convert JS date time to MySQL datetime

Does anyone know how to convert JS dateTime to MySQL datetime? Also is there a way to add a specific number of minutes to JS datetime and then pass it to MySQL...

database Solved
LO
asked 5 months ago by locoboy
0 votes
1 ans
25 views
Get Insert Statement for existing row in MySQL

Using MySQL I can run the query: SHOW CREATE TABLE MyTable; And it will return the create table statement for the specificed table. This is useful if...

database Solved
KI
asked 5 months ago by Kibbee
0 votes
1 ans
28 views
MySQL high CPU usage

Recently my server CPU has been going very high. CPU load averages 13.91 (1 min) 11.72 (5 mins) 8.01 (15 mins) and my site has only had a slight increase in...

database Solved
JU
asked 5 months ago by Juddling
0 votes
2 ans
30 views
MySQL - Using COUNT(*) in the WHERE clause

I am trying to accomplish the following in MySQL (see `pseudo` code) SELECT DISTINCT gid FROM `gd` WHERE COUNT(*) > 10 ORDER BY lastupd...

database Solved
IC
asked 5 months ago by Ice