I m using substr in while loop. Using substr I am getting strike in Text; If I omit substr then I get perfect result. I have to substr function; Is there any another alternate function.

if($countrecords>=0)
	{
     while($row1=mysql_fetch_array($result1))
      {
	  ?>
		<div style="border-top:1px dashed #cccccc; padding-top:10px;">
		
		<div style="font:bold 11px verdana; padding:10px 0 8px 0; width:100%;" class="headinga">
		<a href="show_job.php?id_no=<?php echo $row1['j_id']; ?>" style="color:#551001; font:bold 12px verdana">
		<?php echo $row1['j_heading']; ?></a>
		</div>
		
		<div style="width:100%;">
		<?php 
		echo substr($row1['j_des'], 0,600).'  ..........'; ?>
		</div>
		
		<div style="color:red;padding:0px 8px 30px 0px;font-family:Verdana;  ">
		<a href="show_job.php?id_no=<?php echo $row1['j_id']; ?>" style="color:blue; font:normal 12px verdana; float:right;" >
		more... </a>
		</div>
		
		</div>
		<?php
        }
      }
?>

Recommended Answers

All 5 Replies

the substring works for me
are you sure that $row is a string?
or maybe I don't understend 'getting strike in Text'

the substring works for me
are you sure that $row is a string?
or maybe I don't understend 'getting strike in Text'

It is working on Local but not on server, and second thing it is not string; its is BLOB type in mysql.

a BLOB is not a string
can't you use a VARCHAR
you are just echo-ing it so a assume it's just a large text

a BLOB is not a string
can't you use a VARCHAR
you are just echo-ing it so a assume it's just a large text

So.. There is any solution?; coz I have to use substr function.. there is any alternate function.. ?

substr("$row1", 0, 600);
try this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.