<?php
if(!empty($_POST['code'])){
$code = strtoupper($code);
$param[':code'] = $_POST['code'];
$sql .= 'AND `code` = :code';
}
?>
strtoupper don't working. Why? Any advices?
<?php
if(!empty($_POST['code'])){
$code = strtoupper($code);
$param[':code'] = $_POST['code'];
$sql .= 'AND `code` = :code';
}
?>
strtoupper don't working. Why? Any advices?
You need to sanitize this. As it appears you are trying to build a SQL query.
However, try something like this...
<?php
if(!empty($_POST['code'])){
$code = strtoupper($code);
$sql .= 'AND `code` = ' . $code;
}
?>
$code
is useless, just use $_POST
if(!empty($_POST['code'])){
$param[':code'] = strtoupper($_POST['code']);
$sql .= 'AND `code` = :code';
}