Only variables should be passed by reference – php end()
Posted on July 27th, 2009 by Fred
See : http://bugs.php.net/bug.php?id=48937
If you’re using something like this:
$itemsArray[]= end(explode('/',$item));
change to this:
$parts = explode('/',$item);
$itemsArray[]= end($parts);
This is a PHP "type juggling" issue
http://php.net/manual/de/language.types.type-juggling.php
solution ex:
$nomeArq = explode(".", $arquivo["name"]);
$extArq[]= end($nomeArq);
$sql = "INSERT INTO public.arquivo
(
arqnome,
arqextensao,
arqdescricao,
arqtipo,
arqtamanho,
arqdata,
arqhora,
usucpf,
sisid
)VALUES(
'".current(explode(".", $arquivo["name"]))."',
'".$extArq[0]."',
'".$dados["arqdescricao"]."',
'".$arquivo["type"]."',
'".$arquivo["size"]."',
'".date('d/m/Y')."',
'".date('H:i:s')."',
'".$_SESSION["usucpf"]."',
". $_SESSION["sisid"] ."
) RETURNING arqid;";
$arqid = $db->pegaUm($sql)
Discussion Area - Leave a Comment