Jump to content

[SOLVED] str_replace help


imperialized

Recommended Posts

 

    	#connec to DB and get their info to replace the codes
	$query = mysql_query("SELECT * FROM poker_users WHERE email='$email'");
	while($x = mysql_fetch_array($query)){
			$fname = $x['fname']; 
			$lname = $x['lname'];
			$poker_name = $x['poker_name'];

		str_replace("%fname%", $fname, $msg);
		str_replace("%lname%", $lname, $msg);
		str_replace("%pname%", $poker_name, $msg);

		print "$msg";

		exit;
	}

 

That's my code, the variables from the database are coming out just fine. The variables %fname% etc are coming through a form and are being sent correctly.

 

It outputs: %fname% %lname% %pname%

 

and does not replace them with the new vars.. any help is appreciated. Thanks

Link to comment
https://forums.phpfreaks.com/topic/162981-solved-str_replace-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.