Posts by NewtonWagner • 152 points
9 posts
-
1
votes3
answers1100
viewsA: How to run PHP code only once a day?
Another way to get the same result is to use a task scheduler (in Linux it is called CRON) so that the load execution is performed automatically by the Operating System, preferably outside of peak…
phpanswered NewtonWagner 152 -
1
votes1
answer74
viewsA: Know if value from an input is a link from XX site. PHP - Codeigniter
You can check if the address you passed is a valid Facebook URL. The first one that comes to mind is: - Every Facebook profile URL should start with "http://facebook.com/" or https. So you can use…
-
3
votes1
answer323
viewsA: Foreach inside the while on the Json exit
Within WHILE(), for each car you need to make a new query in the gallery table and include these objects in the car. An example: while($obj = mysqli_fetch_object($result)) { $sql_galeria = "SELECT *…
-
1
votes2
answers123
viewsA: Problems with Insert logic
There are some errors in your logic. The function mysql_query() should be assigned to a variable that receives its output, for example: $resultado = mysql_query($string_sql, $conn); Just below, in…
-
-2
votes5
answers7129
viewsA: Number of weeks in a month
Follows a possible solution: /** * Calcula a quantidade de Semanas em um mes * * @param string $mesAno Mes e Ano no formato MM/AAAA. Ex.: 05/2014 * @return int Quantidade de semanas no mes */…
-
1
votes3
answers1556
viewsA: Filter word in text with php
In this case you can use regular expressions (function: ereg_match or preg_match). To get the ID value, for example, you can use: $ereg_pattern = '/ID : (\d*)/'; $string = "ID : 123123 Nome : Elvis…
phpanswered NewtonWagner 152 -
0
votes2
answers183
viewsA: Help with post upload and move file manipulation in PHP
Check the directory permissions. If the environment is Linux, you can use the chmod() PHP command after the transfer: More info: http://jp1.php.net/manual/en/function.chmod.php…
phpanswered NewtonWagner 152 -
0
votes6
answers1555
viewsA: How to do the following query without using INNER JOIN?
Answering the question: No. You have two different keys and need a JOIN for each key to find the description of the second table. Any solution other than this will alter the outcome of your query,…
-
4
votes5
answers145
viewsA: Strange behavior in a possible way to comment
Just adding to comments that have already responded to Javascript comment formats, look for code writing standardization (coding standards), which makes it easy for you or anyone else to maintain…
javascriptanswered NewtonWagner 152