LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

422 solutions found in database

Page 1 of 22
0 votes
2 ans
13 views
How to fix "mbind: Operation not permitted" in mysql error log

I have a problem with my MySQL error log which currently mostly consists of "mbind: Operation not permitted" lines (see below). Why does it happen and...

database Solved
GA
asked 2 months ago by gamaverse
0 votes
2 ans
11 views
How to remove the querystring and get only the URL?

I'm using PHP to build the URL of the current page. Sometimes, URLs in the form of www.example.com/myurl.html?unwantedthngs are requested. I want...

database Solved
NA
asked 2 months ago by Navi Gamage
0 votes
2 ans
12 views
How to query between two dates using Laravel and Eloquent?

I'm trying to create a report page that shows reports from a specific date to a specific date. Here's my current code: $now = date('Y-m-d&#39...

database Solved
WO
asked 2 months ago by wobsoriano
0 votes
2 ans
14 views
How to Remove Array Element and Then Re-Index Array?

I have some troubles with an array. I have one array that I want to modify like below. I want to remove element (elements) of it by index and then re-index arra...

database Solved
DA
asked 2 months ago by daGrevis
0 votes
1 ans
9 views
Parse query string into an array

How can I turn a **string** below into an **array**? pg_id=2&parent_id=2&document&video This is the array I am looking for, array(...

database Solved
RU
asked 2 months ago by Run
0 votes
1 ans
10 views
How to get the jQuery $.ajax error response text?

I am sending an error response to my jQuery. However, I can not get the response text (in the example below this would be **Gone to the beach**) The only th...

database Solved
JA
asked 2 months ago by jantimon
0 votes
2 ans
11 views
Cannot simply use PostgreSQL table name ("relation does not exist")

I'm trying to run the following PHP script to do a simple database query: $db_host = "localhost"; $db_name = "showfinder";...

database Solved
KE
asked 2 months ago by Keyslinger
0 votes
2 ans
10 views
Convert flat array to a delimited string to be saved in the database

What is the best method for converting a PHP array into a string? I have the variable `$type` which is an array of types. $type = $_POST[type]; I...

database Solved
PH
asked 2 months ago by Philip Kirkbride
0 votes
2 ans
13 views
How to order a Laravel query builder result by multiple columns?

I want to sort multiple columns in Laravel 4 by using the method `orderBy()` in Laravel Eloquent. The query will be generated using Eloquent like this: S...

database Solved
SO
asked 2 months ago by Sophy
0 votes
2 ans
12 views
PHP: merge two arrays while keeping keys instead of reindexing?

How can I merge two arrays (one with string => value pairs and another with int => value pairs) while keeping the string/int keys? None of them will ever...

database Solved
GA
asked 2 months ago by Garrett
0 votes
2 ans
9 views
How to query all the GraphQL type fields without writing a long query?

Assume you have a GraphQL type and it includes many fields. How to query all the fields without writing down a long query that includes the names of all the fi...

database Solved
BL
asked 2 months ago by BlackSigma
0 votes
1 ans
10 views
Get URL query string parameters

What is the "less code needed" way to get parameters from a URL query string which is formatted like the following? > www.mysite.com/category/su...

database Solved
EN
asked 2 months ago by enloz
0 votes
2 ans
12 views
How to filter an associative array comparing keys with values in an indexed array?

The callback function in [`array_filter()`][1] only passes in the array's values, not the keys. If I have: $my_array = array("foo" =...

database Solved
MA
asked 2 months ago by maček
0 votes
1 ans
11 views
How to secure database passwords in PHP?

When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission logi...

database Solved
US
asked 2 months ago by user18359
0 votes
2 ans
11 views
Laravel Eloquent Query: Using WHERE with OR AND OR?

How do I say `WHERE (a = 1 OR b =1 ) AND (c = 1 OR d = 1)` For more complicated queries am I supposed to use raw SQL?

database Solved
FA
asked 2 months ago by Farzher
0 votes
2 ans
11 views
Are PDO prepared statements sufficient to prevent SQL injection?

Let's say I have code like this: $dbh = new PDO("blahblah"); $stmt = $dbh->prepare('SELECT * FROM users where username =...

database Solved
MA
asked 2 months ago by Mark Biek
0 votes
1 ans
11 views
How to find the foreach index?

Is it possible to find the `foreach` index? in a `for` loop as follows: for ($i = 0; $i < 10; ++$i) { echo $i . ' '; } `$i`...

database Solved
US
asked 2 months ago by user18334
0 votes
2 ans
11 views
Can I bind an array to an IN() condition in a PDO query?

I'm curious to know if it's possible to bind an array of values to a placeholder using PDO. The use case here is attempting to pass an array of values...

database Solved
AN
asked 2 months ago by Andru
0 votes
1 ans
10 views
How to pass an array within a query string?

Is there a standard way of passing an array through a query string? To be clear, I have a query string with multiple values, one of which would be an array...

database Solved
YA
asked 2 months ago by Yarin
0 votes
1 ans
9 views
How to Create Multiple Where Clause Query Using Laravel Eloquent?

I'm using the Laravel Eloquent query builder and I have a query where I want a `WHERE` clause on multiple conditions. It works, but it's not elegant....

database Solved
VE
asked 2 months ago by veksen