Lỗi Hàm Kết Nối

Thảo luận trong 'PHP & MYSQL' bắt đầu bởi garidinh, 5/10/13.

  1. garidinh

    garidinh Rất nhiệt tình

    Bài viết:
    239
    Likes :
    68
    Mình có 2 kết nối như sau :
    1 : $con=mysqli_connect("example.com","peter","abc123","my_db");
    2: $con=mysql_connect("example.com","peter","abc123","my_db");

    Cái thứ nhất ko báo lỗi, nhưng cái thứ 2 bao lỗi ( mysql va mysqli); vậy nguyên nhân vì sao ? các bạn giúp mình với
     
  2. Nguyen Che Linh

    Nguyen Che Linh Rất nhiệt tình

    Bài viết:
    103
    Likes :
    45
    bác thử in lỗi ra xem lỗi gì, rồi xử e nó lun :)
     
    garidinh thích bài này.
  3. zobibobo

    zobibobo Rất nhiệt tình

    Bài viết:
    328
    Likes :
    75
    The mysql_*() family of functions is based on an old C wrapper that is not maintained. It's really old, and scripted to be deprecated in future versions of PHP. MySQLi makes use of Prepared Statements, which are immune to SQL Injection attacks. MySQLi can be used in the same way as the mysql_*() functions, or in an OO manner

    :D
     
    garidinh thích bài này.
  4. garidinh

    garidinh Rất nhiệt tình

    Bài viết:
    239
    Likes :
    68
    Hóa ra là vậy :)
     
comments powered by Disqus
: msqli

Chia sẻ trang này