3
I am doing the following Insert:
<?php
include "conexao.php";
$v_tipo = $_POST ["tipo"];
$v_funcao = $_POST ["funcao"];
$v_numero = $_POST ["numero"];
$v_responsavel = strtoupper($_POST['responsavel']);
$v_tag = strtoupper($_POST['tag']);
$v_loja = $_POST ["loja"];
$v_local = strtoupper($_POST['local']);
$v_conteudo = strtoupper($_POST['conteudo']);
$insert = "INSERT INTO refrigeracao
(refri_id,
refri_tipo,
refri_funcao,
refri_numero,
refri_responsavel,
refri_tag,
refri_loja,
refri_local,
refri_conteudo)
VALUES (NULL,
'$v_tipo',
'$v_funcao',
'$v_numero',
'$v_responsavel',
'$v_tag',
'$v_loja',
'$v_conteudo',
'$v_local')";
mysql_query($insert);
echo '<script>alert(\'Dados cadastrados com sucesso!\');parent.location =\'index.php\';</script>';
?>
And I’m using the strtoupper
for when the user type minute letters automatically save them in uppercase, when the field is only text this working,more in the case of $v_tag = strtoupper($_POST['tag']);
which is numbers and letters this saving only the numbers, ?
Give an example of this
tag
is to work, other options are mb_convert_case or do this in the database.– rray
refri_tag
is sweep?– rray
yes it is varchar yes
– Chefe Druida
example how to save: 1C2B33CD even if the user typed 1c2b33cd
– Chefe Druida
The problem does not seem to be this code, it goes straight to the bank, there in the Insert change to:
upper('$v_tag'),
– rray
perfect. Thanks. More then I will see the PHP documentation and see why otherwise did not work out, more straight in the bank was. Thanks again.
– Chefe Druida
So the description of the problem does not match the code, it seems to have something external causing this situation.
– rray
As well,I did not understand it well, ?
– Chefe Druida
Reading recommendation : Why should we not use mysql type functions_*?
– Guilherme Lautert
For example run,
echo strtoupper('ação 2015');
, do not check the accented characters is expected, but 'cut' the letters does not, so said, seem to have something external interfering.– rray
I get it,.
– Chefe Druida
@Guilherme Lautert Great article, I’m already studying the PDO for migration. Thank you
– Chefe Druida
Possible duplicate of php strtoupper() with accents
– Julyano Felipe