dflow Posted May 12, 2009 Share Posted May 12, 2009 im trying to create a text template where the name of a city is replaced according to the url parameter $_GET from the city list tbl i have uploaded text in binary code to mysql as BLOB i get the text but not the city name that should be echoed, it is blank for example great things to see in <?php echo $RsCity['CityName']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/157809-using-blob-in-dynamic-content/ Share on other sites More sharing options...
Adam Posted May 12, 2009 Share Posted May 12, 2009 Perhaps show us the SQL, bit more code? Quote Link to comment https://forums.phpfreaks.com/topic/157809-using-blob-in-dynamic-content/#findComment-832281 Share on other sites More sharing options...
dflow Posted May 12, 2009 Author Share Posted May 12, 2009 i think the answer to this is using eval() Quote Link to comment https://forums.phpfreaks.com/topic/157809-using-blob-in-dynamic-content/#findComment-832297 Share on other sites More sharing options...
.josh Posted May 12, 2009 Share Posted May 12, 2009 personally I would use [CITYNAME] in the text and preg_replace it. Much cleaner than eval. edit: I guess str_replace would be better than preg since its exact string search. Quote Link to comment https://forums.phpfreaks.com/topic/157809-using-blob-in-dynamic-content/#findComment-832312 Share on other sites More sharing options...
dflow Posted May 12, 2009 Author Share Posted May 12, 2009 personally I would use [CITYNAME] in the text and preg_replace it. Much cleaner than eval. edit: I guess str_replace would be better than preg since its exact string search. ok i have tried both BLOB and TEXT fields structures with the following code <?php $str="[CITYNAME] is a nice place to visit"; $cn="Paris"; $text=str_replace("[CITYNAME]", $cn, $str); echo $text."<br>"; ?> i echo the variable like this <?php echo $row_RsEvent_Types['textcontent']; ?> i get <td>"; ?> </td> Quote Link to comment https://forums.phpfreaks.com/topic/157809-using-blob-in-dynamic-content/#findComment-832332 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.