Posts by Bruno • 1,304 points
185 posts
-
-1
votes1
answer89
views -
0
votes2
answers1769
viewsQ: Protect from sql Injection in php
I have this code to insert: $name = isset($_POST["DescricaoProd"]) ? $_POST["DescricaoProd"] : ''; $unid = isset($_POST["DescricaoUnid"]) ? $_POST["DescricaoUnid"] : ''; if (!empty($name) &&…
-
0
votes1
answer37
views -
2
votes1
answer72
views -
3
votes1
answer1430
views -
1
votes1
answer138
viewsQ: Change form when renaming in combobox
I have this code to create multiple forms within the same page, and when changing the form name it changes form on the same page: <select id="mudar_produto"> <option…
-
2
votes2
answers200
viewsQ: Select checkbox when placing value from a text box
I intend that by placing a value on <input type="number" /> automatically select the <input type='checkbox' />. Follows my HTML: <div> <input type='checkbox'…
-
2
votes1
answer123
viewsQ: Variable out of while is zero
I make the total sum as follows in while: $TotalSIva6 = 0; $TotalSIva7 = 0; $TotalCIva6 = 0; $TotalCIva7 = 0; while($rows_cursos3 = mysqli_fetch_array($result3)) { $teste24 = $rows_cursos3['Valor'];…
-
1
votes1
answer1144
viewsQ: create print button for each table
I have 3 different tables on the same php page and I plan to print each table separately from each other. Code I am using: <?php echo $tabela3; echo $tabela4; echo $tabela5; echo…
-
0
votes2
answers1469
viewsQ: Convert from decimal or integer to php hours
I have the result in decimal or integer of hours: Utilizador 1 = 71.5 horas Utilizador 2 = 137 horas I wanted to convert inside php to hours, as an example: Utilizador 1 = 71:30 Utilizador 2 =…
-
8
votes1
answer270
viewsQ: Result when converting minutes to hours
I have a query where I have an example that gives the correct result and the other one does not when converting minutes to hours. 1st example in minutes: SELECT A.Colaborador, SUM(A.`Horas…
-
1
votes1
answer55
viewsQ: Consultation system
I have this form to consult only for a period of time or only by the client’s name or to consult for a period of time and a specific client: <form method="POST" action=""> <strong>Data…
-
0
votes3
answers100
viewsQ: Align titles in html
I have this image where I want to align all titles surrounded by red at the same level: Code: echo '<div><table border="1"><th colspan="2">Infância</th><th…
-
0
votes1
answer38
viewsQ: Create title for two columns
I have this code to create the following tables side by side: echo '<div><table border="1"><tr><td>'; echo '<div><table border="1" style="width:150px"> <td…
-
0
votes1
answer473
viewsQ: place table next to other table in php
I have these two loops : $result = mysqli_query($conn, $sql); $result1 = mysqli_query($conn, $sql1); $tabela1 .= '<div style="float: center" table align="center">'; $tabela1 .= '<table…
-
0
votes2
answers402
viewsQ: SUBSTRING_INDEX in mysql
I have these values in the table of the database, where in the field array the comma separates as if it were a column. The data is this way: Id------arrachar 1…
-
1
votes2
answers262
viewsQ: Extract exploded results from a column
I entered several data inside the same column with the implode, now I want to extract the results of the query with the explodes so as to keep the data separate so that later I can work them. I have…
-
3
votes2
answers181
viewsQ: check if the day exists or not with the if
I need to check if the day doesn’t exist... do Insert, if yes, update. I set an example in practice of what I need: if(ver se existe no banco){ .....if(){ ..........faz insert .....} }else{ .... faz…
-
0
votes1
answer108
viewsQ: Inserts blank lines when inserting foreach
I am entering in the same column all the data of my form, which contains checkboxes and inputs type="number": $calendar .= "<td bgcolor='#F5F5F5' align='center'…
-
0
votes1
answer57
viewsQ: Show only those that are not common between two querys in mysql
I have this first query that only shows the names with the current day registration date: SELECT nome, centrodb.registoMiDe.Quarto, DataRegisto, Miccao, Tipo1, Dejeccao, Tipo FROM centrodb.utentes…
-
1
votes2
answers39
viewsQ: Insert only the filled line in php
I have this code: <?php $j=0; while($rows_cursos = mysqli_fetch_array($resultado_cursos)) { $tabela1 .= '<tr>'; $tabela1 .= '<td> <input type="text" size="45" name= "NomeUtente[]"…
-
0
votes1
answer34
viewsQ: Show date and time to current user
I have this code: while($rows_cursos = mysqli_fetch_array($resultado_cursos)) { $tabela1 .= '<td> <input type="date" name= "Data[]" id= "Data" value="<?php echo date("Y-m-d");?>…
-
1
votes1
answer27
viewsQ: Show variable in specific location with a div
I have this while where I created a variable before the while to then get the total of a column: $Total = 0; while($rows_cursos = mysqli_fetch_array($resultado_cursos)) { $teste =…
-
0
votes1
answer82
viewsQ: Insert two checkbox in different fields in mysql
I have this code that creates this table with the first two fields already filled in pattern: <?php $result_cursos = "SELECT nome, Quarto FROM centrodb.utentes WHERE descricaovalencia = 'LAR' AND…
-
2
votes1
answer2172
viewsQ: Convert everything to mysql in hours or minutes
I have a table with the two fields Start and End of Tipo de dados Time. Example of records I have in the table: 09:30:00 10:00:00 10:00:00 11:00:00 11:00:00 12:00:00 As I show, I have full hours and…
-
1
votes1
answer110
viewsQ: checkbox filled with php database data
I have this code that creates the calendar and checkbox: <?php # PHP Calendar (version 2.3), written by Keith Devens function generate_calendar($year, $month, $days = array(), $day_name_length =…
-
1
votes1
answer60
viewsQ: insert only the row that receives value in the date column
I have this code: <?php $result_cursos = "SELECT nome, Quarto FROM centrodb.utentes WHERE descricaovalencia = 'LAR' AND nome <> 'CLASSE' AND ativo = '1' ORDER BY nome ASC;";…
-
-1
votes2
answers177
viewsQ: Create combo with names within input value
have input with name contributor inside the while: while($rows_cursos = mysqli_fetch_array($resultado_cursos)) { $tabela1 .= '<tr>'; $tabela1 .=…
-
1
votes1
answer106
viewsQ: Create type=Submit input inside the calendar code
Calendar code with checkboxes on each day of the month to mark meals: <?php # PHP Calendar (version 2.3), written by Keith Devens function generate_calendar($year, $month, $days = array(),…
-
0
votes1
answer195
viewsQ: Create combo with months to filter in the calendar
I want to create a filter per month in the calendar. Code: <!DOCTYPE HTML> <html lang="pt-pt"> <head> <meta charset="UTF-8"> <title>Registo Refeições</title>…
-
1
votes0
answers360
viewsQ: Create filter in a graph
I have the following chart that works with the following code: <html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>…
-
0
votes1
answer66
viewsQ: Chart display on page
I have this chart with the following query to the database: <html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script…
-
0
votes1
answer49
viewsQ: Different colors in cells
I make a query and show the result in a table as shown in the image: I intend that the column Zone when he shows up Daycare the cell turns red when it is Exterior the white one, when it’s Center in…
-
2
votes1
answer153
viewsQ: Place euro symbol in a table
In my consultation I have two column where I do the sum of hours and the sum of the amount to be paid by the client in those hours: Line summing the hours: CAST(SUM(SEC_TO_TIME(E.teste1))/100 AS…
-
0
votes3
answers1130
viewsQ: Take the selected value in a cell and subtract with the combobox value in vba
Good afternoon, I have the selected cell and now I want to take the value of that selected cell and subtract it from the combobox value and then take that result and put it into the selected cell.…