azisnomarsa Posted June 17, 2007 Share Posted June 17, 2007 Techincally I have been staring at this coe fpr about 30 mins now, but I cant get where am I wrong,, I mean, image exists and all, but output still is without images . <?php $omg = mysql_connect('localhost', '', ''); if (!omg) { die(' ' . mysql_error()); } mysql_select_db("blogging", $omg); $wii = mysql_query("SELECT * FROM ftw"); while($rrr = mysql_fetch_array($wii)) { $zinja = str_replace( "", "<img src='/bildes/smile.gif'>,", $zinja ); echo "$zinja"; $amen = strip_tags($rrr['avtor']); $buda = strip_tags($rrr['mudak']); echo $amen; echo "<br>"; echo $buda; } ?> Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 17, 2007 Share Posted June 17, 2007 where does the $zinja variable come from? I do not see that variable any where in your code. Quote Link to comment Share on other sites More sharing options...
azisnomarsa Posted June 17, 2007 Author Share Posted June 17, 2007 Well as I understood from tuts I make variable with str_replace and then I just print it. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 17, 2007 Share Posted June 17, 2007 Yes you can create a var to store what str_replace will return. But you got to pass it a source to do replacements with. $zinja = str_replace( ":)", "<img src='/bildes/smile.gif'>,", $zinja ); Everything highlighted above is correct. Except for the highlighted variable in red. That variable must contain the raw data that contains the raw smiley symbols for str_replace to replace it. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 17, 2007 Share Posted June 17, 2007 Im going to guess that maybe it should be: $zinja = str_replace( "", "<img src='/bildes/smile.gif'>,", $rrr['zinja'] ); Quote Link to comment Share on other sites More sharing options...
azisnomarsa Posted June 17, 2007 Author Share Posted June 17, 2007 Thank you it woked. Now I understand my mistake. Just great Quote Link to comment 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.