Posts by Felipe Pacheco Paulucio • 172 points
13 posts
-
-1
votes2
answers66
viewsA: How to limit the number of SQL lines according to a variable?
1º Deactivate the PDO::ATTR_EMULATE_PREPARES What prevents the values passed by ->execute([...]) always appear as strings. $conn->setAttribute( PDO::ATTR_EMULATE_PREPARES, false ); 2º LIMIT…
-
1
votes1
answer83
viewsA: How to send two forms in a request via Ajax
I believe it is not possible to send two forms by AJAX request, but I have a suggestion Any fields you send to AJAX, add a class to it, example "form-search". In your AJAX function, search all…
-
1
votes1
answer42
viewsA: ARRAY DATABASE
In your CODE, MATERIAL and QUANTITY input you can receive multiple values, then you will receive one ARRAY in PHP. Example of use, using your case: $material = $_POST["material"]; $codigo =…
-
0
votes2
answers41
viewsA: Display default image if not in the database
The error is in that line echo '<div style="background: url(<?= base_url() ?><?= $user['photo'] ?>); position: relative; left: 48%; background-size: 48px 48px; width: 48px; height:…
phpanswered Felipe Pacheco Paulucio 172 -
1
votes5
answers38375
viewsA: Convert date to dd/mm/yyyy format
STRTOTIME does not accept the dd/mm/yyyy format. To convert dd/mm/yyyy to yyyy-mm-dd you can use the function createFromFormat and format as in the example below DateTime::createFromFormat('d/m/Y',…
-
0
votes2
answers227
viewsA: How to save variable and use after page refresh
To be able to store the variable even after the page update, use $_SESSION. To log into the file you are working = session_start(); $_SESSION['ssid'] = @$_POST['user']; // Aqui você está armazenando…
phpanswered Felipe Pacheco Paulucio 172 -
-1
votes1
answer41
viewsQ: Ajax with PHP is not recognizing POST method index field
I’m making a system for restaurant orders, and I have a part to share commands. I have a javascript to create input commands I want to split, with maximum size of 3 command inputs <script…
-
5
votes4
answers4894
viewsQ: PHP returning wrong current time
I’m having a problem using the function date using the parameters to return the current time. When I use the function: $hora = date('H:i:s'); When I give a echo in the variable $hora to verify, I…
-
0
votes1
answer44
viewsQ: Inserting Id of a Foreign Key into a Relational Database
Good morning. I am beginner in Database and programming and have a question, which query to recover the id to insert in a table with foreign key? I am using the MYSQL database. Example, I have the…
-
1
votes1
answer103
viewsQ: Binary tree printing only left side
Hello. My binary tree is printing only the left side, what can it be? I am using TAD to implement. Tree structure: typedef struct _no { int conteudo; struct _no *esquerda; struct _no *direita;…
-
0
votes1
answer136
viewsQ: Infinite loop while recovering and recording data in Firebase
I’m a beginner on Android and had a problem recovering data from Firebase and record again, I know the reason for the infinite loop but I don’t know how to fix. public static void setVoto (String…
-
0
votes0
answers128
viewsQ: Advertisement Admob appears only once
Hello, can someone help me with this problem? When I run my app on the emulator, the ad appears normally at all times, but when I run it on my mobile the ad appeared only once and did not appear…
-
3
votes1
answer97
viewsA: how do I resolve this exercise in c/c++
First error in your code is in the variable "sum", we should initialize it as 0 if we increment from it, because of the memory junk. double soma = 0, media; For you to store the stores, I recommend…