i created a new page that select the title of nodes under a category with id cid=7 from my database but i v some encoding plm
you can see it at this link

http://www.elnasllnas.com/site/article2.php

the code of the page is :




Untitled Document


<?
include('connectDB.php');
$result =mysql_query("SELECT * FROM `category_node` WHERE cid=7 ");
while($row = mysql_fetch_array($result))
{
$hosam=$row[nid];
$results =mysql_query("SELECT title FROM node WHERE nid=$hosam");
while($rows= mysql_fetch_array($results))
{

echo $rows[title]."";

}
}
?>

Note :
my database is utf8

Comments

nevets’s picture

From your posting this does not look like it is related to Drupal at all.

cog.rusty’s picture

I have no idea what you already have in the included connectDB.php, but try setting your database connection to utf-8 first. with a

mysql_query("SET NAMES 'utf8'");

.

Additionally you can try

mysql_query("SET CHARACTER SET 'utf8'");

.

(assuming that your Drupal tables have the correct encoding.)

mdotcomegypt’s picture

Thancks cog.rusty you are the the best !!!!!
your solution fixed one of the biggest Plm i faced