15-04-2007, 17:47
|
|
|
|
חבר מתאריך: 02.10.05
הודעות: 2,355
|
|
אני עובד ב- UTF-8... אבל זה לא עובד.. הנה הקוד PHP (שאגב, יש הצעות לשיפור? אני לא ממש מרוצה מהסידור הזה...)
קוד PHP:
mysql_query("SET NAMES utf8"); //protecting the table because we need a reliable result mysql_query("LOCK TABLES `messeges` WRITE"); //read the last id $query = mysql_query("SELECT MAX(id) AS `id` FROM `messeges`") or die("Error on query! MySQL Said: ".mysql_error()); $maxid = mysql_fetch_array($query); // "Generate" new id :) $newId = ++$maxid['id']; mysql_query("UNLOCK TABLES"); //write the messege //Send a new thread mysql_query("INSERT INTO `messeges` ( id, rootid, parentid, subject, conty, time ) values ( ".$newId.", ".$newId.", 0, '".mysql_real_escape_string($_POST['subject'])."', '".mysql_real_escape_string(str_replace("\r\n", '', nl2br($_POST['content'])))."', '".time()."' ) ") OR die('Error on query, MySQL said:'.mysql_error());
מה שכן, כשהכנסתי להודעה תוכן באנגלית הכל עבד פיקס..
עריכה
ניסיתי פעמיים למחוק וליצור מחדש את עמודה, אבל לא עובד :S
_____________________________________
נערך לאחרונה ע"י tnadav1 בתאריך 15-04-2007 בשעה 17:56.
|