LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 29 of 106
0 votes
1 ans
3 views
Format number to 2 decimal places

I would like to know how can I output a number with 2 decimal places, without rounding the original number. For example: 2229,999 -> 2229,99 I a...

general-dev Solved
TE
asked 1 month ago by Tenza
0 votes
1 ans
3 views
Calculate difference between two datetimes in MySQL

I am storing the last login time in MySQL in, `datetime`-type filed. When users logs in, I want to get the difference between the last login time and the curren...

database Solved
DE
asked 1 month ago by Devesh Agrawal
0 votes
1 ans
3 views
Delimiters in MySQL

I often see people are using Delimiters. I tried myself to find out what are delimiters and what is their purpose. After 20 minutes of googling, I was not able...

database Solved
SY
asked 1 month ago by System.Data
0 votes
1 ans
3 views
Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem

I've been struggling with this for some time. I've installed Rails 3, gem, mysql on my Snow Leopard machine. All was going well until I created my fi...

server-admin Solved
JO
asked 1 month ago by Jonty Brook
0 votes
1 ans
3 views
mySQL :: insert into table, data from another table?

I was wondering if there is a way to do this purely in sql: q1 = SELECT campaign_id, from_number, received_msg, date_received FROM `received_t...

database Solved
HA
asked 1 month ago by Hailwood
0 votes
1 ans
3 views
SQL UPDATE all values in a field with appended string CONCAT not working

Here is what I want to do: current table: +----+-------------+ | id | data | +----+-------------+ | 1 | max...

database Solved
FR
asked 1 month ago by Fresheyeball
0 votes
1 ans
3 views
PHP/MySQL insert row then get 'id'

The 'id' field of my table auto increases when I insert a row. I want to insert a row and then get that ID. I would do it just as I said it, but is t...

database Solved
HI
asked 1 month ago by Hintswen
0 votes
1 ans
3 views
SQL order string as number

I have numbers saved as `VARCHAR` to a MySQL database. I can not make them `INT` due to some other depending circumstances. It is taking them as character n...

database Solved
JA
asked 1 month ago by Jamol
0 votes
1 ans
3 views
How to escape apostrophe (a single quote) in MySQL?

The [MySQL documentation][1] says that it should be `\'`. However, both SciTE and MySQL shows that `''` works. I saw that and it works. What shou...

database Solved
US
asked 1 month ago by user4951
0 votes
1 ans
3 views
GROUP_CONCAT comma separator

I have a query where I am using `GROUP_CONCAT` and a custom separator as my results may contain commas: '----' This all works well, however it is sti...

general-dev Solved
US
asked 1 month ago by user984580
0 votes
1 ans
3 views
How to create a database from shell command in MySQL?

I'm looking for something like createdb in PostgreSQL or any other solution that would allow me to create database with a help of a shell command. Any hints...

database Solved
AK
asked 1 month ago by akizd
0 votes
1 ans
3 views
How to fix "Incorrect string value" errors?

After noticing an application tended to discard random emails due to incorrect string value errors, I went though and switched many text columns to use the `utf...

php-dev Solved
BR
asked 1 month ago by Brian
0 votes
1 ans
3 views
Import SQL file into mysql

I have a database called `nitm`. I haven't created any tables there. But I have a SQL file which contains all the necessary data for the database. The file...

database Solved
KU
asked 1 month ago by kushalbhaktajoshi
0 votes
1 ans
3 views
MySQL - Get row number on select

Can I run a select statement and get the row number if the items are sorted? I have a table like this: mysql> describe orders; +-------------+...

database Solved
GE
asked 1 month ago by George
0 votes
1 ans
3 views
What is this operator <=> in MySQL?

I&#39;m working on code written by a previous developer and in a query it says, WHERE p.name &lt;=&gt; NULL What does `&lt;=&gt;` mean in this query?...

database Solved
ZZ
asked 1 month ago by zzlalani
0 votes
1 ans
3 views
MySQL: Sort GROUP_CONCAT values

In short: Is there any way to sort the values in a GROUP_CONCAT statement? Query: GROUP_CONCAT((SELECT GROUP_CONCAT(parent.name SEPARATOR &quot; &amp;...

database Solved
IV
asked 1 month ago by Ivar
0 votes
1 ans
3 views
MySQL "NOT IN" query

I wanted to run a simple query to throw up all the rows of `Table1` where a principal column value is not present in a column in another table (`Table2`). I...

database Solved
KJ
asked 1 month ago by KJ Saxena
0 votes
1 ans
3 views
How to show a MySQL warning that just happened?

I just ran a simple MySQL CREATE TABLE statement that produced the line &gt;&quot;Query OK, 0 rows affected, 1 warning (0.07 sec).&quot; It didn&#39;t a...

database Solved
PO
asked 1 month ago by Pops
0 votes
1 ans
3 views
How to recover MySQL database from .myd, .myi, .frm files

How to restore one of my MySQL databases from `.myd`, `.myi`, `.frm` files?

database Solved
CH
asked 1 month ago by chandrajeet
0 votes
1 ans
3 views
Mysql adding user for remote access

I created user `user@&#39;%&#39;` with `password &#39;password`. But I can not connect with: mysql_connect(&#39;localhost:3306&#39;, &#39;user&#39;, &#39...

database Solved
US
asked 1 month ago by user2333586