Posts by Leandro Marzullo • 1,401 points
132 posts
-
1
votes3
answers286
viewsQ: To create alphabetical list in PHP according to variable number
I need to create a list of letters in alphabetical order, according to the variable $nalternatives, for example: $alternativas = 3; aí preciso criar: a b c If $nalternatives is 2, then it’s just a,…
-
2
votes1
answer46
viewsQ: How to create records in the MYSQL table according to the value of the $nregistros PHP variable
I have a $nregistros variable that defines the value of records to be inserted in the table "Formularios". If $nregistros is equal to 4 for example, it should insert 4 rows as follows: formularios…
-
0
votes1
answer4357
viewsQ: Google Maps error (This page did not load Google Maps correctly)
Lately, all the sites I created and used maps, is showing this message Do you know if anything has changed in google? any settings in the API?…
-
0
votes0
answers209
viewsQ: Is it possible to open a link in a specific browser tab using some target=""?
I have a contact registration system with a button to send Whatsapp message by whatsappweb. When I click on this button, it opens a whatsappweb tab in the conversation with this contact: <a…
-
0
votes0
answers113
viewsQ: How to search for similar words (spelling errors) in MYSQL
I am building a search system using Mysql and PHP, with a fomulário in the _GET method. I wanted to set up a system that if the person type wrong, the site can "correct" the word, or suggest the…
-
5
votes2
answers446
viewsQ: How to take 2 PHP arrays and join in 1 string
I have 2 PHP arrays that come from a form $_POST['qtd'] and $_POST['ing']: array(2) { [0]=> string(1) "1" [1]=> string(1) "2" } array(2) { [0]=> string(1) "a" [1]=> string(1) "b" } It…
-
0
votes2
answers436
viewsQ: How to insert DIV with input fields inside the DIV using jquery or javascript
I have a simple form with add button that when I click it adds 3 text inputs: <form method="POST"> <div id="ingredientes"> </div> <button type="button"…
-
1
votes1
answer155
viewsQ: How to use a svg (or div) to click and select the corresponding checkbox
I have a form that is a recipe search filter. In this filter I have a checkbox group for the category: <form method="get" action="/busca"> <h4>Categoria</h4> <input…
-
0
votes1
answer77
viewsA: How to redirect a search result page (/search?term=brazil) to another page (/country/brazil)
I found the solution: https://www.formget.com/how-to-redirect-a-url-php-form/ When doing the search it checks the term that was searched, so if it is equal to what I predefined, it directs: Seeking:…
-
0
votes1
answer77
viewsQ: How to redirect a search result page (/search?term=brazil) to another page (/country/brazil)
I am setting up a website recipes that has a search that is a form with GET method and MYSQL query to bring the results. I wanted when someone does a specific search, for example brazil, to go to a…
-
0
votes1
answer291
viewsQ: How to query MYSQL in 2 columns and sort 1st results of title column and then Description column
I’m setting up a job agency website and I have a search that searches the field title and description, what the person searched, as per the query below: SELECT * FROM vagas WHERE (titulo LIKE…
-
0
votes1
answer82
viewsQ: How to pick variable and print several "<li>" according to the variable number?
I have a variable $abas = 4. I need PHP to make one echo in the variable number, in this case it would be 4. The result should be: <li>1</li> <li>2</li>…
-
0
votes1
answer271
viewsQ: Can you create a rule in MYSQL to divide the value of one column by another?
I want to know the average of the values (value m2) in a table using AVG() (or otherwise). I have a table in MYSQL with the columns id, total value (Total value), value m2 (Value per m²) and area.…
-
0
votes0
answers350
viewsQ: How to Paginate using PHP and MYSQL
I have a simple query that brings the results and assembles a table and I wanted after the table to come a pagination: (), but I don’t know how to do. The consultation is like this:…
-
0
votes2
answers901
viewsQ: How to use Multiple select in PHP form to query in MYSQL
I have a search with a select that can select more than one option, but I don’t know how to make them search all the selected options. Currently it does the search, inserts the values in the url (I…
-
0
votes1
answer246
viewsQ: How to delete all JPG files inside a folder using PHP
I have a script that imports photos and creates mini and medias thumbnails inside the registration folder and I would like that after you run this one, it erases the original photos. The structure…
-
1
votes1
answer173
viewsQ: PHP MYSQL Query Bring Results from Today and This Week
I’m assembling type a CRM, where makes queries in MYSQL with PHP to bring the appointments I have today, this week and all others. I wish you’d bring something like that: Hoje: compromisso A…
-
-1
votes1
answer32
viewsQ: How to generate sequential variables (e.g.: D1, D2, D3) and then merge everything into a single PHP variable
I have script using foreach that generates the variables $d, $m, that receive the value of a mysql query and puts this value in the input echo " <input type='text' name='tipo' value='".$d."'>…
-
0
votes3
answers1387
viewsQ: How to use checkbox group to search with php and mysql
I’m developing an immovable site with a search, where one of the filters is the neighborhood. Currently it is a Dropbox, but I would like to swap by checkbox group to be able to select more than 1…
-
1
votes2
answers1049
viewsQ: How to query MYSQL and PHP using an array as a WHERE pro condition
I’m making a query in MYSQL that brings the emails that were sent. These emails are in the email column, separated by comma, as in the email table below. emailsenviados IDenvio|emails 1…
-
1
votes1
answer293
viewsQ: How to count how many fields are empty in the mysql table
I have a land register table with several columns (some of them: id, address, city, proposal, etc) and I would like to count how many fields are empty. For example, the table has a total of 44…
-
3
votes2
answers304
viewsQ: SQL query unifying 3 tables
I have 4 tables that I need to join them in a single query where the result is: nome |COUNT(terrenosDeCadaID)|COUNT(conversasDeCadaID) joao | 2 | 3 maria| 1 | 2 The tables are like this: users…
-
0
votes0
answers131
viewsQ: PHP Mail sends email to spam
I am wanting to send an email using phpmail, but it always falls as spam. There is something I can do to not get into spam? I made a very simple code to test: mail($email,"Assunto do email","Corpo…
-
1
votes1
answer134
viewsA: How to "merge" foreach results
I solved by adding the line $names.=$name.'|'; and use the Insert with $Names value after all $idlancamento=$_GET['idlancamento']; echo ' <form action="" method="post"…
-
0
votes1
answer134
viewsQ: How to "merge" foreach results
I have a script to upload multiple files in php. Then when uploading, I wanted him to insert in the table photos, the information with the names in this format: "name1.jpg|Nome2.jpg". The query I…
-
2
votes1
answer40
viewsQ: PHP min($footage) bringing the wrong value
I have a variable $footage that in var_dump brings me: array(5) { [0]=> string(5) "111,5" [1]=> string(2) "81" [2]=> string(4) "90,8" [3]=> string(4) "79,6" [4]=> string(1) "6" } I…
phpasked Leandro Marzullo 1,401 -
-1
votes2
answers80
viewsQ: Insert line in MYSQL without leaving the page (using PHP)
I have a music download system with a download button and I would like when clicking the button, it insert a line in the database, without leaving the page. Currently what I did is it open a new…
-
0
votes1
answer247
viewsA: Query Mysql with 3 tables
I decided by making the query using left Join with select inside another: SELECT u.id, u.name, r.visualizacoes, f.favoritos, r.datav FROM sir_users u LEFT JOIN (SELECT iduser, SUM(views)…
-
0
votes1
answer247
viewsQ: Query Mysql with 3 tables
I have the following query that should bring the sum of views and last view (table sir_ter_relatorios_terrenos), sum of favourites (table sir_ter_favoritos) and the person’s name (table sir_users)…
-
1
votes0
answers39
viewsQ: Single and double quotes giving error in PHP
I have the following code: $db -> setQuery(" INSERT INTO sir_ter_historico (idcorretor,data,alteracao) VALUES ($id, '$data', '$_POST['form']['numero']'); "); $db->execute(); Only it’s wrong,…
phpasked Leandro Marzullo 1,401 -
0
votes3
answers399
viewsQ: How to select the last rows added in a mysql table
I have the following table sir_ter_conversa which is a conversation history. id|idterreno|idincorporadora|idusuario|msg|data 1 | 1 | 771 | 771 | a |2018-05-27 10:20:00 2 | 1 | 771 | 773 | b…
-
1
votes3
answers393
viewsQ: Get last ID or date inserted in a Mysql table
I have a history of conversations that are recorded in the table sql "conversation" and I want to pick up who was the last person who inserted a message in the conversation to know if it was the…
-
0
votes1
answer722
viewsQ: How to replace all values of a given table in MYSQL at once?
I have a table (produtos) who has the spine product_params Several products have the value of this table with max_order_level="" and I want to replace everyone for max_order_level="1", i.e., change…
mysqlasked Leandro Marzullo 1,401 -
1
votes2
answers113
viewsQ: Javascript find part of the text and replace (with variable)
I have a photo slideshow that when you click on the photo it opens the bigger photos. In the gallery of larger photos, I just need to pass the value start:nºda foto, for it to start from the clicked…
javascriptasked Leandro Marzullo 1,401 -
1
votes1
answer217
viewsQ: How to insert a row in the sql table when clicking the button?
I have an immovable site that I am implementing the option of favorites. When opening the property and clicking favorite, it should insert in a new row in the favorite table, this one below (status…
-
5
votes1
answer77
viewsQ: Query to find if value is between "1|3"
I have a table units that represents the number of dormitories of the buildings: id| dorm 1 | 1|3 In this case above means that id 1 has units with 1 or 3 dormitories. Then I have a search using…
-
0
votes0
answers44
viewsQ: How to create equal stack overflow tag field?
I am developing a website of recipes and one of the fields to register the revenue, are the tags. I wanted to put a function equal to the stackoverflow, an input that as I type it brings the tags…
-
2
votes3
answers1237
viewsQ: How to insert a new line in the json file, using PHP?
In the code snippet config.json, need that whenever you run a PHP script, it will insert a new line below, with the number in sequence and corresponding id: "assignment": { "0": "292", "1": "280",…
-
1
votes3
answers90
viewsQ: How to "break" the PHP variable and bring separate results
I’m a beginner in php. I have these variables: $tipo='a,b,c,d'; $metragem='15,18,32,44'; And I need him to bring a: 15 b: 18 c: 32 d: 44 but if the values are like those below: $tipo='a,,,';…
phpasked Leandro Marzullo 1,401 -
0
votes2
answers30
viewsQ: PHP split a variable separated by "|" and bring all results that are not empty
I have a variable that are the footage of the building units and each unit is separated by "|" and may have up to 4 units, ex: 35|41|50|12. But it doesn’t always have 4 units, ex: 41|50|| Then I…
phpasked Leandro Marzullo 1,401 -
1
votes1
answer914
viewsQ: Select hide/show Divs according to the selected value (jquery)
I have a select and some Divs like this: <select name="numerounidades" id="numerounidades"> <option value="1">1</option> <option value="2">2</option> <option…
-
3
votes1
answer460
viewsQ: Button to insert new inputs into the form
I have a website that records building launches. Then some buildings have more than one tower, and I would like for each tower, I had the possibility to insert 4 inputs (type, footage, dormitories,…
-
3
votes1
answer923
viewsQ: How to Create Event in MYSQL?
I’m learning now about create Event in mysql I’m creating a simple test Event, but it’s not working, it appears in Events, but the table is not updated: CREATE EVENT teste ON SCHEDULE AT…
-
-1
votes1
answer78
viewsQ: How to change MYSQL database when 1 month registration date expires
I have a register of VIP users who make a payment that registration lasts 1 month. When payment is made, the status column of the users_vip table is updated to 1…
-
1
votes1
answer100
viewsQ: Query 2 SQL tables bring all the results
I’m doing an SQL query to bring users, but I consult 2 tables: users and users_vip No users have all users and users_vip only those who are vip (active or not). When I make my query joining the 2…
-
1
votes2
answers1722
viewsQ: SQL query with PHP array
I have an array that will be variable, e.g.: $ref = array('123', '654', '555'). I wanted to make an SQL query to bring the information of these references, something like: SELECT * FROM tabela_itens…
-
0
votes0
answers24
viewsQ: Create PHP encrypted file download link
I have a site where users can download the files. These files are with the path in an sql table and have an access key and the request id. Hj file download is direct at url, ex: <a…
-
-1
votes1
answer22
viewsQ: Insert value in sql table using "part" of the form
I have a form for registering revenue. When I finish the registration, the revenue is added in the table "recipes". All ingredients are also in a separate table called "ingredients". My form looks…
-
0
votes1
answer78
viewsQ: Create x quantity of <li> according to variable $pages in php
I have a variable $pages that brings the amount of pages. Then I need for each page to create a li, ex: $paginas = 3; sairia o resultado: <li>1</li> <li>2</li>…
phpasked Leandro Marzullo 1,401 -
0
votes1
answer20
viewsQ: SQL query with OR gets slow
I have an appointment that does the search using: WHERE pt.product_name LIKE '%termo da busca%' Then I want the search also look for the artist’s name and put: WHERE pt.product_name LIKE '%termo da…