php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76247 Problema ordenar arrays
Submitted: 2018-04-21 15:22 UTC Modified: 2018-04-21 16:01 UTC
From: celestinoxp at hotmail dot com Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 7.2.4 OS: Windows 10
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: celestinoxp at hotmail dot com
New email:
PHP Version: OS:

 

 [2018-04-21 15:22 UTC] celestinoxp at hotmail dot com
Description:
------------
Ao tentar ordenar uma chave de loteria que se encontra numa base de dados, o php não mostra nada.

Problema no código, na ligação à base de dados, na ordenação, ou BUG no PHP!

Test script:
---------------
<?php

include "../ligar_bd.php";

ini_set('display_errors', 1);
ini_set('display_startup_erros',1);
error_reporting(E_ALL);

/*** Exemplo de código *********************************************************************
$frutas = array("d" => "limao", "a" => "laranja", "b" => "banana", "c" => "melancia");
asort($frutas);
foreach( $frutas as $chave => $valor ){
    echo "$chave = $valor\n";
}
********************************************************************************************/


$result = mysqli_query($db, "SELECT * FROM `table32`");

while ($dados = mysqli_fetch_array($result, MYSQLI_BOTH))
{
	$valores = array("n1" => $dados['n1'], "n2" => $dados['n2'], "n3" => $dados['n3'], "n4" => $dados['n4'], "n5" => $dados['n5'], "n6" => $dados['n6']);
	
	asort($valores);		

	foreach ($valores as $n => $val)
	{
		echo $n." = ".$val;
		//$sql = mysqli_query($db, "UPDATE `table32` SET ".$n." = ".$val." WHERE `table32`.`id` = $dados['id']") or die("Erro!");
	}	
}

?>

Expected result:
----------------
A chave deveria ser ordenada e apresentada

Actual result:
--------------
Não mostra nada, nem erros!

Página em branco!!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-21 15:26 UTC] spam2 at rhsoft dot net
seriously? i don't even know what language that is!
 [2018-04-21 15:49 UTC] celestinoxp at hotmail dot com
-Status: Open +Status: Closed
 [2018-04-21 15:49 UTC] celestinoxp at hotmail dot com
Problem found.
Sorry inconvenience...
 [2018-04-21 16:01 UTC] cmb@php.net
-Status: Closed +Status: Not a bug -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 20:01:29 2024 UTC