Posts by Sr. André Baill • 6,946 points
384 posts
-
1
votes1
answer226
viewsQ: Jquery does not validate Incorrect password
I got the following jQuery $(document).ready(function(){ $('#email').focus(); $("#formLogin").validate({ rules :{ email: { required: true, email: true}, senha: { required: true} }, messages:{ email:…
-
4
votes2
answers4594
viewsA: Delete string-specific word
You can also choose to use this regular expression, which causes the '' inserted by html, $string = "Texto com linha <br> e linha 2"; $string = str_replace("<br>", "", $string); In MYSQL…
-
0
votes1
answer409
viewsA: Filter Records by Month/Year Codeigniter
I was able to find a solution. If anyone needs it, it’s there. SELECT EXTRACT(MONTH FROM data) AS mes, EXTRACT(YEAR FROM data) AS ano, COUNT(id) AS total_noticia, (CASE month(data) when 1 then…
-
0
votes1
answer409
viewsQ: Filter Records by Month/Year Codeigniter
I have the following SQL structure: CREATE TABLE IF NOT EXISTS `noticia` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_categoria` int(11) DEFAULT NULL, `titulo` varchar(255) NOT NULL, `previa` text…
-
5
votes4
answers4010
viewsQ:  - This error appears between the <body> and gives space difference
How do I remove this error? Is causing spacing in the site header.…
htmlasked Sr. André Baill 6,946 -
-1
votes1
answer356
viewsQ: Subselect within a field
I am displaying several fields through a SELECT: SELECT razaosocial, nomefantasia, cnpj, ie, im, endereco, endereco_numero, endereco_complemento, codCedente FROM cliente WHERE razaosocial LIKE…
sqlasked Sr. André Baill 6,946 -
0
votes1
answer2514
viewsQ: Fatal error: Unsupported operand types | PHP error
Inside this Script, gives the following error: Fatal error: Unsupported operand types in C: Easyphp-Devserver-14.1VC11 data localweb Administrating application holerites holerites.php on line 126…
phpasked Sr. André Baill 6,946 -
3
votes2
answers76
viewsA: Error passing variable as double parameter
Make separate: $pesquisa_data_inicio = "2015-01-02"; $pesquisa_data_final = "2015-02-02"; pesquisaPagamentos($pesquisa_data_inicio, $pesquisa_data_final)
-
1
votes2
answers24
viewsQ: Comparing Salary among Arrays()
I have the following Query: SELECT * FROM folhapagamento_storages WHERE idFolhaParametro = '1' AND valor_min >= '1083.4' AND valor_max <= '1083.4' Only that the return will always be 0, what…
sqlasked Sr. André Baill 6,946 -
0
votes2
answers105
viewsA: Print results in a feed interspersed with horizontal spaces (blank line)
I would do it that way, to differ from each other: <?php //conexão + select $query = mysql_query("SELECT"); if(mysql_num_rows($query)) { ?> <p class=""> <ul class=""> <?php…
-
0
votes2
answers144
viewsA: error help . htaccess
You can do it this way too: $pag = (isset($_GET['pag'])) ? $_GET['pag'] : 'default'; $pasta = "nav"; if(file_exists($_SERVER['DOCUMENT_ROOT']."/{$pasta}/{$pag}.php")){…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer31
viewsA: Upload Out of Place
You can do so too: if(is_uploaded_file($_FILES["foto"]["tmp_name"])) { mkdir("../img/".$Npasta) or die("erro ao criar diretório $Npasta"); $foto = time() . "_" . $_FILES["foto"]["name"]; $diretorio…
-
0
votes3
answers512
viewsA: Add new field and leave it empty
Sirs, I got the solution that way: //clona linha e atribui novo ID incrementando tmp = $(this).parent().clone(true); tmp.find('.limpar_campo').val(""); tmp.appendTo( $(this).parent().parent() );…
jqueryanswered Sr. André Baill 6,946 -
3
votes3
answers512
viewsQ: Add new field and leave it empty
I am using a jQuery (clone) to copy a line and add it to the element, but if I have this line filled in, it comes exactly like this! I need that when cloning this line, the forms come empty. HTML…
jqueryasked Sr. André Baill 6,946 -
3
votes3
answers14718
viewsA: How to put line breaking in a textarea?
You can put using: Echo nl2br($row['campo']);
phpanswered Sr. André Baill 6,946 -
1
votes1
answer81
viewsQ: Create Mysql Database Table
I have the following table in CSS: I need to create the tables of the Mysql database, however, I’m not sure how to work this... It will be just "Updated" all the information in the table... What…
-
1
votes1
answer466
viewsA: Organize schedules in the Database
You can arrange as follows: id_horario // auto increment id_linha // linha pré cadastrada id_saida // cidade saida id_destino // cidade destino dia_da_semana // segunda a domingo horario // horário…
-
2
votes1
answer263
viewsQ: Enable field by selecting "Type"
I have the following field: <div class="line"> <label class="control-label">Tipo</label> <select class="input-xxlarge idTipo" name="idTipo" id="idTipo" onChange="getParametro()"…
jqueryasked Sr. André Baill 6,946 -
4
votes1
answer71
viewsQ: Select brings different results
I’m having a problem at a SELECT: SELECT * FROM documento WHERE idAdministrador = '1' AND modulo = 'funcionario' OR modulo = 'atestado' I need you, if module is working or attested, to do the…
sqlasked Sr. André Baill 6,946 -
2
votes1
answer505
viewsQ: Format Array differently
I have the following array(): Array ( [valor] => Array ( [0] => 433.36 [1] => 433.36 [2] => 433.36 [3] => 433.36 [4] => 433.36 [5] => 433.36 [6] => 433.36 [7] => 433.36…
-
1
votes1
answer126
viewsA: Dynamic table
You can apdatate this code for your use: <select class="input-xxlarge empresaRegistro" name="empresaRegistro" id="empresaRegistro" style="width: 715px !important;" onChange="getFuncionario()">…
-
0
votes1
answer31
viewsQ: Add '%' and format value in text field
I have a field in shape text: <input type="text" name="base_calculo" id="base_calculo"> I would like you to add the % symbol at the end of this field and format the field like this: 0.0% Thank…
jqueryasked Sr. André Baill 6,946 -
0
votes2
answers372
viewsA: Set field to null - Codeigniter
Usually I wear the unset() function atualizarFuncionario($dados){ if ($dados['dtnascimento'] === '') { unset($dados['dtnascimento']); } $where = array( 'idfuncionario' => $dados['idfuncionario'],…
-
2
votes2
answers268
viewsA: How to mount an SQL to display grouped content per month?
$consulta = mysql_query("SELECT * FROM tabela GROUP BY MONTH(data)"); while($row=mysql_fetch_array($consulta)){ $consulta_mes = mysql_query("SELECT * FROM tabela WHERE month(data) =…
-
1
votes2
answers114
viewsA: php day counting system
In your SQL to select the date: SELECT * FROM tabela WHERE data BETWEEN CURRENT_DATE()-15 AND CURRENT_DATE(); If the return is positive (true), the date is less than 15 days, then it is no longer…
-
3
votes1
answer922
viewsA: How to display a specific image?
I’d do it that way: <?php include ('config.php'); $sql = mysql_query("SELECT * FROM filmes ORDER BY nome_filme"); echo " <table> <tr> <td>COD</td>…
-
2
votes2
answers1716
viewsA: Displays items as selected from a select (HTML)
The Menu file you can do this way: <form method="post" enctype="multipart/form-data"> <select onchange="getBebidas()" name="idCardapio" id="idCardapio"> <option value="0">Selecione…
-
0
votes2
answers381
viewsA: Trying to make the login work, but shows no error but also does not enter
Well, I would do a little different. For conditions to run and show a possible error, even if it is not from Mysql: session_start(); if ($_POST['botao']=="Entrar"){ $query = "SELECT * FROM usuarios…
-
2
votes2
answers5168
viewsA: Update with Codeigniter
In your HTML, add: <input type="hidden" value="<?php echo dados[0]->id; ?>" name="id"> Inside your model, disable: $this->db->set($data);…
-
4
votes3
answers1222
viewsA: Filters with PHP - Search Form
According to the database mentioned above, I believe that whatever you would like to do, as selecting or filling the data, will mount SQL to run. // STATUS if(isset($_POST['STATUS_ATIVIDADE']))…
-
12
votes1
answer28159
viewsA: select only by month of a particular column - mysql
To be able to filter certain records within Mysql, you can do it as follows: Filtering Records by the Day SELECT * FROM tabela WHERE DAY(data) = 'dia_escolhido' Filtering Records by Month SELECT *…
-
0
votes2
answers1887
viewsA: property registration php mysql
$qtdParc = 3; $varlorTotal = 300; $calculoParc = ($valorTotal/$qtdParc); $data = explode('/','20/11/2015'); for($i=1; $i<=$qtdParc; $i++){ $retorno = mktime(0, 0, 0,…
-
4
votes1
answer80
viewsQ: Comparison of Array() Results
I have an Array() of results, I need to buy if the city of array 0 is equal to the city of array 1, if the city of array 1 is equal to the city of array 2... and so on. My SQL print_r resulted in…
phpasked Sr. André Baill 6,946 -
2
votes0
answers101
viewsQ: Comparison of Cities between Stretches
Hello! I am developing a system that consists of registering sections by neighborhood or city. In this case, which I am taking as an example, it includes only two excerpts, as I show in the figure.…
-
0
votes1
answer125
viewsA: Logging in form_validation does not validate as expected
If it helps you, I use this function to check the Login: public function verificarLogin(){ $this->load->library('form_validation');…
-
2
votes1
answer74
viewsA: How to count equal items from 5 different columns?
I’d do it this way: Table structure. CREATE TABLE IF NOT EXISTS `frequencia` ( `idFrequencia` int(10) NOT NULL AUTO_INCREMENT, `idUsuario` int(10) NOT NULL, `diaSemana` int(10) NOT NULL, `presenca`…
mysqlanswered Sr. André Baill 6,946 -
0
votes1
answer868
viewsQ: Recover data in Modal in PHP
I have a button that calls a screen modal, passing the ID of the registration in question. I would like to know how to recover the data from that ID, at the moment that display Modal, so that it can…
-
2
votes4
answers2160
viewsQ: When filling in the Date field, perform a jQuery action
I have a field data and I need that when I finish filling the date... Perform a function to list a SELECT form. <input id="dp1" class="input-small" onkeyup="mascaraData(this);" name="data"…
-
1
votes4
answers6197
viewsA: Resume all values in stdClass Object Array
You can elaborate as follows: $dados = $seccionais->fetchAll(PDO::FETCH_OBJ); foreach($dados as $valor){ echo $valor->seccionaldescricao; echo "<br>"; } This way he will look for the…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer81
viewsA: Error Mysql syntax
Change this line: $sql = mysql_query("insert into filme(nome, categoria, img, lancamento, sinopse, hora, video, data, type, size, subcategoria, tipo, tam)…
-
4
votes2
answers386
viewsA: a:Stop working with :visited or :link
Create a Class in css to manage these links: .MenuLink { text-decoration: none; color: red; } a.MenuLink { text-decoration: none; color: red; } a:hover.MenuLink { text-decoration: underline; color:…
-
2
votes1
answer55
viewsA: Doubt about upload code
You can develop as follows: <?php //SISTEMA DESELVOLVIDO POR LUCIANO ZANITA | [email protected] //requerendo o banco de dados a conexão include "conecta.php"; //PROPRIEDADES DO UPLOAD DO…
phpanswered Sr. André Baill 6,946 -
1
votes2
answers47
viewsQ: Enable fields in Jquery
I have the following fields: <label class="control-label">KM</label> <input class="input-small" style="width: 50px !important;" type="text" name="km" value=""> <label…
jqueryasked Sr. André Baill 6,946 -
0
votes2
answers1010
viewsA: Questions about Notice Undefined variable
I would do it this way: if(isset($_POST['login'])){ $login = $_POST['login']; $sql = mysql_query( "SELECT * FROM usuario WHERE login='{$login}' ") or print mysql_error(); $linha =…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer654
viewsA: php code for simple installments
You can elaborate a variable to do the calculation and print it. Like this example: <?php $vezes = $_product->getData('parcelas'); $calc =…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer47
viewsA: How to return an integer value for the Rows in the codeiginter?
Set a variable for the record number search: $query = $this->db->where("categoria_titulo", $categoria); $query = $this->db->get("categorias"); $query_num = $query->num_rows(); echo…
-
2
votes1
answer229
viewsA: Delete via php
You can create that way: <? include ('conection/config.php'); $conn = mysqli_connect ($varBDhostname,$varBDusername,$varBDpassword,$varBDdatabase); if(isset($_GET['deletar'])): $id =…
phpanswered Sr. André Baill 6,946 -
2
votes1
answer682
viewsA: Return mysql result with function
In his função alter: $row = $query->fetchAll(PDO::FETCH_ASSOC); print_r($query->errorInfo()); To: $row = $query->fetchAll(PDO::FETCH_ASSOC); return $row; In his foreach do: <tbody>…
-
1
votes3
answers432
viewsA: Insert into seat with function
You can draw up this way a foreach(), to search all fields posted and enter in the database: foreach($_POST as $key=>$val){ $dados[$key] = $val; $campos = implode(",", $key);…
-
1
votes1
answer48
viewsA: Print form with: 1.photo in the post 2. id auto increment generated in the form Insert. How is it in PHP?
In your form, when sending it, you can use the foreach to register the data in the database, according to the example: foreach($_POST as $campo => $valor){ echo "No campo $campo tem o valor…