Migration from MYSQL to MYSQLI functions
In the future the php mysql functions will be deprecated and so we have implemented mysqli functions in Syndeocms 3.2.This means that before you migrate to 3.2 you have to change your own template code.
Syntax for mysql and mysqli Functions:
mysqli Function | mysql Function |
---|---|
mysqli_connect($db_server, $db_username, $db_password, $db_name) | mysql_connect($db_server, $db_username, $db_password) followed by mysql_select_db($db_name) |
mysqli_errno($db) | mysql_errno() or mysql_errno($db) |
mysqli_error($db) | mysql_error() or mysql_error($db) |
mysqli_fetch_array($result) | mysql_fetch_array($result) |
mysqli_fetch_assoc($result) | mysql_fetch_assoc($result) |
mysqli_fetch_row($result) | mysql_fetch_row($result) |
mysqli_insert_id($db) | mysql_insert_id($db) |
mysqli_num_rows($result) | mysql_num_rows($result) |
mysqli_query($db,$query) | mysql_query($query) or mysql_query($query,$db) |
mysqli_select_db($db,$dbname) | mysql_select_db($dbname) |
mysqli_real_escape_string($db,$data) | mysql_real_escape_string($data) |
If you use a editor like notepad++ you can do following replaces:
mysql by mysqli
mysqli_query( by mysqli_query($db,
0 comments:
Post a Comment