Проблем с charset-a на последни теми от IPB форум

roskata

Registered
Здравейте, имам проблем с charset-a като изкарам последни теми от форума. Променил съм всичко и в IPB-то да е навсякъде windows-1251, и пак ми ги изкарва в началната с ?????????. Ето го и кода:

Код:
<?php

				$db_host = "localhost";

				$db_user = "root";

				$db_password = "";

				$db_name = "";

				$table_preffix = "ipb_";

				

				$show_topics = 10;

				$forum_path = "http://www.site.com/forum/";

				

				$table_topics = $table_preffix."topics";

				

				$connection = @mysql_connect($db_host, $db_user, $db_password) or die ("MySQL Fatal Error");

				@mysql_select_db($db_name);

				

				$query = mysql_query("SELECT * FROM $table_topics ORDER BY tid DESC LIMIT 0, $show_topics");

				while($row = mysql_fetch_array($query)) {

					$title = $row[title];

					$address = $row[tid];

					$address = $forum_path."index.php?showtopic=".$address;

					

					echo '<a href="'.$address.'">'.$title.'</a><br /> ';

				}

			?>

Благодаря.
 
<?php

$db_host = "localhost";

$db_user = "root";

$db_password = "";

$db_name = "";

$table_preffix = "ipb_";



$show_topics = 10;

$forum_path = "http://www.site.com/forum/";



$table_topics = $table_preffix."topics";



$connection = @mysql_connect($db_host, $db_user, $db_password) or die ("MySQL Fatal Error");

@mysql_select_db($db_name);
mysql_query("SET NAMES cp1251")or die(mysql_error());


$query = mysql_query("SELECT * FROM $table_topics ORDER BY tid DESC LIMIT 0, $show_topics");

while($row = mysql_fetch_array($query)) {

$title = $row[title];

$address = $row[tid];

$address = $forum_path."index.php?showtopic=".$address;



echo '<a href="'.$address.'">'.$title.'</a><br /> ';

}

?>

[/code]

Благодаря.
 
сигурен ли си че трябва да е cp1251 да не е utf8 ?
ако не е от това погледни в MySQL да не би записите да са ти от сорта на ?????? :)
 

Back
Горе