Questions tagged as 'mysql'

1
answer

I can not make search work with eloquent and relationship !!! Laravel 5.5 and mysql

I am doing a search by taking a word part and playing in a search type LIKE for fields fields. I use Eloquent and relationships, but it does not bring the data. { $pesquisa = $dataForm['pesquisa']; $atestados = Atestad...
asked by 19.12.2018 / 12:07
1
answer

foreach selective two tables

Please help me, I'm a beginner. Well, I'm with a site with codeigniter, it's showing my recipes perfectly on: <?php foreach ($receitas as $receita) :?> Now I want to create a loop that only shows recipes that are in favorites, whic...
asked by 18.12.2018 / 14:42
3
answers

Help with select in MYSQL [closed]

I would like to know how I do to list the oldest customers for each city, I tried several commands but without success. I would like you to quote automatically. Here are some commands I used, but I did not get the expected result. selec...
asked by 17.12.2018 / 02:53
2
answers

How to execute a function whose name is in the database?

I would like to know how to execute a JavaScript function by taking its name from the database. Example: data["nome_coluna"] // essa será a informação que estará no banco. (exemplo: somar();) // Aí o objetivo é executar essa função dentro de...
asked by 12.11.2018 / 20:22
1
answer

Error no count ()

I need to put a website in the air (it was not me who made the site), and I need to adjust some things in it. I'm facing a problem in a dynamic menu: when I'm on the home page it's ok, but if I browse the site the following error occurs:  ...
asked by 18.09.2018 / 13:41
2
answers

Error using many to many laravel

I have a group of Users that have Many To Many relationship, to create this relationship I made a beLongsToMany function within the Users model. But every time I call this function I get the following message:   Uncaught exception 'BadMethodC...
asked by 20.09.2018 / 20:10
1
answer

mysql select order by starting today's date

I have this query that looks for birthdays of the month: $mesHoje = date("m"); $sqlAni = $pdo->prepare('SELECT * FROM aniversario WHERE MONTH(dia) = :mesHoje ORDER BY dia ASC'); $sqlAni->execute(array("mesHoje" => $mesHoje)); How d...
asked by 23.10.2018 / 16:29
1
answer

Does not insert information into the database

Good afternoon, I'm trying to insert data into a database and I get the error message: "Could not register the user". I'm using Xamp software, with both Apache and Mysql installed. The code is as follows: <head> <meta...
asked by 18.10.2018 / 17:10
1
answer

How to make a LINQ query that returns the amount of people who were born per month?

I would like to make a LINQ query that returns the amount of people who were born in the month. In MySQL I make this query: SELECT COUNT(*) AS DataNacimento FROM pessoas WHERE MONTH (DataNascimento) = '12'; In LINQ I tried this query, bu...
asked by 24.11.2018 / 20:44
3
answers

How to do Update in Linq?

My project has the Delete method, but it definitely deletes the record from the table in the database. I would like to instead of delete, change the column record, I have a field called "Status", this field is an Enum with two options "Enable...
asked by 09.11.2018 / 16:34