PHP code
<?php
header("Access-Control-Allow-Origin: *");
require 'dbconnect.php';
$conn=new mysqli($server,$user,$pass,$dbname);
$m=$_POST['no2'];
$sql = "INSERT INTO Users(no1,no2,Shop_id,Price) VALUES('".$_POST['no1']."','str_replace("+","0",'$m')','".$_POST['Shop_id']."','".$_POST['Price']."')";
$result=mysqli_query($conn,$sql);
if(!$result){
echo "string";
}
$conn->close();
?>
I want to replace the string received from the query POST($m)with a string that does not contain '+' ie remove '+' from the string.
I tried replacing it with "0" (after all hope), but still not showing what I intend to see
Say $m=+12345I want it to be $m=12345when pasted into the database
Help me that. I am a lot of newbie.
source
share