Reply
Viewing Database Error
Old 05-21-2008, 07:20 PM Viewing Database Error
Extreme Talker

Posts: 171
php code
PHP Code:
    $sortby 'name';
    
$set 'y';
 
$number 0;

$fp fopen('data.txt','r');
if (!
$fp) {echo 'ERROR: Unable to open file.'; exit;}



while (!
feof($fp)) {
    
$line fgets($fp,1024); //use 2048 if very long lines
    
$row++;
 list (
$url$name$type$img) = split ('\|'$line);
    if (
$sortby == 'name'$sortkey strtolower($name);
    
$col[$row] = array($sortkey$name$type$url$img);
}

fclose($fp);

sort($col);
reset ($col);

$arrays count($col) - 1;

$loop = -1;
while (
$loop $arrays) {
    
$loop++;


       if (
$col[$loop][2] == "$group") {
              
$number++;
      

echo 
'
<td class="td2" valign="top"><div align="center"><a href="http://apps.facebook.com/fluff/fluffbook.php?id='
.$col[$loop][3].'">'.$col[$loop][1].'<br><img src="pets/'.$col[$loop][4].'.png" width="110" class="'.$number.'"></a></div></td>
'
;
   if((
$number 4)==0)
   {
    echo 
"</tr>";
    echo 
"<tr>";
   }
}} 
In some of the names in the data file they have special charactors like




but when my code reads in the database it shows them as
♥
☆
è›™

how can I fix this?

Last edited by simster : 05-21-2008 at 07:22 PM.
simster is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-21-2008, 10:13 PM Re: Viewing Database Error
Extreme Talker

Posts: 171
anyone?
simster is offline
Reply With Quote
View Public Profile
 
Old 05-22-2008, 04:30 AM Re: Viewing Database Error
mtishetsky's Avatar
Super Spam Talker

Posts: 946
Location: Volendam, Netherlands
Probably you should set the correct character set header while sending the page to a browser, and the charset should be equal to the one of those strange characters, most likely UTF-8.
__________________
Free Mobile Phone Themes

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Viewing Database Error
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12478 seconds with 13 queries