freelance, web developer, web designer, hosting, domain name
Comparison of Features
The following table compares the functionality of the three main methods of connecting to MySQL from PHP:
Comparison of Features
The following table compares the functionality of the three main methods of connecting to MySQL from PHP:
1.mysqli ทำงานเป็น Object ในขณะที่ mysql ทำงานเป็นฟังก์ชั่น
2.mysqli รองรับการทำงาน กับ Charsets ต่างๆ ได้ดีกว่า mysql ผมเข้าใจว่า mysqli จะต้องทำการกำหนด charset ก่อนทุกครั้ง และจะไม่มีปัญหาภาษาไทยกับ UTF-8
3.mysqli จะไม่รองรับ mysql ที่ต่ำกว่า 4.1 ดังนั้นถ้าคุณยังต้องใช้ร่วมกับ mysql อิ่นๆ แล้วก็จงใช้ mysql ต่อไปเหอะ เนื่องจากทั้ง 2 แบบทำงานแตกต่างกัน ไม่สามารถใช้งานร่วมกันได้
เรื่องความเร็วนี่ผมคงไม่รู้ละครับ รู้แต่ว่า mysqli เขาออกมาเพื่อแก้ bug ของ mysql เพียงแต่ว่า ที่ยังคงเป็นส่วนขยาย เท่านั้น ก็เนื่องมาจาก การที่ mysqli ไม่สามารถใช้งานได้กับ mysql เวอร์ชั่นต่ำกว่า 4.1 ครับ