Jump to content

help on string..


MDanz

Recommended Posts

i got it working.. but now it comes up blank when the take $usern from mysql..

 

<?php


mysql_connect("localhost", "Master", "password");
mysql_select_db("db");
$lastreply = mysql_query("SELECT * FROM Stacks")or die (mysql_error());

while($rowz = mysql_fetch_array($lastreply)){


$usern = $rowz['username'];

$limitz = 6;
if (strlen($usern) > $limitz)

 $newname = substr($usern, 0, $limitz) . '..'; 


echo $newname;

}



?>

Link to comment
https://forums.phpfreaks.com/topic/184488-help-on-string/#findComment-973899
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.