PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 15th, 2002, 03:53 PM
vaska vaska is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 18 vaska User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
limiting text output...

i'm not sure what it's called in PHP lingo...so i can't find anything about this by searching on the web...

i'd like to limit the amount of text that a loop is outputting...to 500 characters or less...

what's this called? and/or does anybody know a piece of code that can make this happen?

thanks...jv

Reply With Quote
  #2  
Old October 15th, 2002, 03:56 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: limiting text output...

can we see the loop?

Reply With Quote
  #3  
Old October 15th, 2002, 04:07 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: limiting text output...

simple example without knowing what you're trying to do.
php Code:
Original - php Code
  1.  
  2. $aString = str_repeat("tongues ", 1000);
  3. for($i=0; $i<500; $i++)
  4. {
  5.     echo "$aString{$i}";
  6. }

Reply With Quote
  #4  
Old October 15th, 2002, 04:59 PM
vaska vaska is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 18 vaska User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: limiting text output...

YOU ARE NOT ALLOWED TO LAUGH AT MY CODE!!! hehe...

<?
$username="vvvv";
$password="vvvv";
$database="vvvvvv";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM response where a='$blog' ";

$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$i=0;
while ($i < $num) {

$name=mysql_result($result,$i,"name");
$email=mysql_result($result,$i,"email");
$website=mysql_result($result,$i,"website");
$date=mysql_result($result,$i,"date");
$a=mysql_result($result,$i,"a");
$comments=mysql_result($result,$i,"comments");
?>
<table width="425">
<tr span class="unnamed2"><td><a href="mailto:<? echo "$email"; ?>"><? echo "$name"; ?> </a>says...</td></tr>
<tr span class="unnamed5"><td><? echo "$comments"; ?></td></tr>
<tr span class="unnamed3" align="right" valign="top"><td><? echo "$date"; ?><br></td></tr>
<tr><td><hr size="1" noshade><br></td></tr>
</table>
<?
++$i;
}

?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > limiting text output...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway