Posts by Flaviano Silva • 1,131 points
15 posts
-
1
votes3
answers5660
viewsA: How to keep the element scroll always at the bottom
this line of code helped me a lot because I tried to keep the scroll at the end of the various ways but it wasn’t working out! vlw! $("#wrap").animate({scrollTop: $('#wrap').prop("scrollHeight")},…
-
12
votes2
answers23421
viewsQ: Is there any way to dynamically put a mask in php?
I would like to put masks in different fields, all via php, for example: cnpj - "##.###.###/####-##" Cpf - "###.###.###-##" zip code - "#####-###" telephone - "(##)####-####" date - "##/##/####" I…
phpasked Flaviano Silva 1,131 -
25
votes2
answers23421
viewsA: Is there any way to dynamically put a mask in php?
php function that puts format the fields by putting masks. function Mask($mask,$str){ $str = str_replace(" ","",$str); for($i=0;$i<strlen($str);$i++){ $mask[strpos($mask,"#")] = $str[$i]; }…
phpanswered Flaviano Silva 1,131 -
2
votes2
answers7712
viewsQ: How to import data from a txt to Mysql with php?
How to import data from a txt for Mysql with PHP? Explanation: I need to read a txt take all the data and insert it into mysql in a string that at zero position has a four-digit code and at eleven…
-
2
votes2
answers7712
viewsA: How to import data from a txt to Mysql with php?
<?php set_time_limit(0);//zera o limite de tempo $con=mysql_connect('localhost','root','root'); mysql_select_db('raas',$con); if($_POST){ $count=0; $tmp_name =…
-
4
votes3
answers3859
viewsQ: Count the columns of a Mysql table using PHP
As I can count the columns of a Mysql table using PHP, someone knows some command to do this? I tried to do it this way but it didn’t work: $sql4 = mysql_query("show fields from ".$tabela) or…
-
18
votes5
answers22797
viewsQ: How to invert dates in PHP, regardless of format?
How to invert dates in PHP? I need to invert dates in PHP regardless of the input format, be YYYY-mm-dd or dd/mm/YYYYY.
-
4
votes5
answers22797
viewsA: How to invert dates in PHP, regardless of format?
function InvertData($campo){ if(substr($campo,2,1)=='/'){ $campo=substr($campo,6,4).'-'.substr($campo,3,2).'-'.substr($campo,0,2);//2012-10-10 } else { …
-
3
votes2
answers6944
viewsQ: How to calculate the time difference in Mysql?
How to calculate, the difference of hours in the Mysql?
mysqlasked Flaviano Silva 1,131 -
4
votes2
answers6944
viewsA: How to calculate the time difference in Mysql?
To calculate the difference of hours in the Mysql use the Function TIMEDIFF which returns the difference between the hours, along with the Function CURTIME() that returns the current time. Example:…
mysqlanswered Flaviano Silva 1,131 -
3
votes5
answers6102
viewsA: How to create a view in mysql by taking data from 3 tables and repeating the different columns in the result?
you can also use LEFT JOIN SELECT t1.id, t1.nome, t1.cnpj, t1.qtd1, t2.qtd2, t3.qtd3 FROM tabela1 t1 LEFT JOIN tabela2 t2 on (t1.id = t2.id) LEFT JOIN tabela3 t3 on (t1.id = t3.id) or with the WHERE…
-
4
votes5
answers14658
viewsA: How to validate date taking into account leap year?
date validation with javascript, also checks whether the year is leap. <html> <head> <title>valida data</title> <script> function valData(data){//dd/mm/aaaa day =…
-
0
votes2
answers19115
viewsA: Mysql Workbench Import and Export
<?php $username = "root"; $password = "root"; $hostname = "localhost"; $dbname = "test"; header('Content-Description: File Transfer'); header('Content-Type:…
-
3
votes1
answer1477
viewsQ: How to import Firebird data to mysql?
How to import data from Firebird for Mysql using the PHP?
-
12
votes5
answers14658
viewsQ: How to validate date taking into account leap year?
How to validate leap year date in Javascript?