I know I have to use the % instead of * but if someone on the input sets:
Name: a01
I just want to know how to convert it into a select like this
SELECT * FROM username where name LIKE 'a%01%'
This is how I should do it, wright?
[man]str_replace/man
not working for me:
<?php if(isset($_POST['submit_form'])) { $teste = "tes*e"; $bodytag = str_replace($teste, "*", "%"); echo $bodytag; } ?>
Expected output: tes%e Output: %
$str = "tese"; $order = ''; $replace = '%'; $bodytag = str_replace($order, $replace, $str); echo $bodytag;
Done... thnks 🙂
I am agreed with "bradgrafelman" By using str_replace() we can SELECT * from a sql database.