Posts by Raphael Ramos • 231 points
11 posts
-
3
votes1
answer187
viewsA: FOR in php and sqlsrv
One thing you can use is sqlsrv_fetch_array $sql = "SELECT FirstName, LastName FROM SomeTable"; $stmt = sqlsrv_query( $conn, $sql ); if( $stmt === false) { die( print_r( sqlsrv_errors(), true) ); }…
-
5
votes3
answers638
viewsA: Is it possible to make a POST from a file automatically?
You can use AWS SDK for PHP - (http://aws.amazon.com/pt/sdk-for-php/ )! There you can control and send files to Amazon through php, even if it is a script running on cron. Now, to read the folder…
-
4
votes2
answers465
viewsA: Is there an alternative to the PHP mysql_connect command?
Yes, the PDO. <?php $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); ?> http://php.net/manual/en/book.pdo.php But this error happens when php version and mysql libraries are…
-
1
votes4
answers2981
viewsA: SQL Query Joining 5 tables
SELECT a.descricao_artigo, p.dt_processo, sp.descricao_situacao_processo, p.pdf_Processo FROM processo_judicial AS p INNER JOIN tp_situacao_processo as sp on p.cd_situacao_processo =…
-
0
votes2
answers49
viewsA: Insert into the database according to the data found
You can do 2 something like: If you are always sure that there will be value in the variable $table, then just 1 foreach. foreach ($tabela_s as $key_s => $value_s){ foreach ($tabela_p as…
-
0
votes1
answer325
viewsA: Empty session updating only DIV
You have to create a javascrip Rigger to update the div. It would be something like $( "#foo" ).on( "custom", function( event) { // Faz o ajax para ir em um php e retornar os valores da session });…
-
1
votes3
answers1232
viewsA: How to extract a word from a PHP URL
Well, come on, that’s a generic function to solve the problem. $text is the text from which you want to remove the word; $word is the word that will be removed; $Pattern is the separator that will…
-
1
votes1
answer2775
viewsA: Empty PHP $_SESSION variable
This may occur if for some reason you are recreating your session every post/Ubmit/refresh. If this happens, it will lose the values of the old Sesame. Take a look, if session_start() code is not…
phpanswered Raphael Ramos 231 -
1
votes3
answers799
viewsA: Delete Item Array
The problem is in the second part of the code. $nota = hasArrayKey( $_SESSION['NOTAS'], '999' ); if( $nota >= 0 ){ unset( $_SESSION['NOTAS'][$nota] ); } if( !$nota ){ echo "Nota not found\n"; }…
-
2
votes3
answers1338
viewsA: How to suspend the $_GET parameter if the array is empty?
You can block the form submission if the value is empty. Can be via javascript or by HTML5 by tag 'required' Otherwise, you have to perform the verification of these values in the backend. In the…
-
2
votes4
answers733
viewsA: How to check if there is only one position in the array element?
You can do a check using the function substr. The function will return the given part of any string. In case it would be something like the code below: if (substr($part["P "], 1, 1) === " "){ // do…