Mysql
 sql >> Database >  >> RDS >> Mysql

xampp php 7 Chiamata a funzioni non definite (mysql e odbc)

se sei ancora interessato, nel caso in cui tu abbia una vecchia fonte con molte funzioni mysql_ potresti usare le funzioni wrapper per mysqli e quindi includerlo in qualsiasi file che usi mysql_ funtions. Il file Wrapper potrebbe apparire come:(potrebbero mancare alcune funzioni, come questo erano tutte le funzioni che ho usato in mysql_)

<?php
if (PHP_VERSION_ID > 59999) 
{
    function mysql_connect($a,$b,$c,$d=null) { return mysqli_connect($a,$b,$c,$d); }
    function mysql_query($a,$b) { return mysqli_query($b,$a); }
    function mysql_affected_rows($a) { return mysqli_affected_rows($a); }
    function mysql_close($a) { return mysqli_close($a); }
    function mysql_fetch_assoc($a) { return mysqli_fetch_assoc($a); }
    function mysql_free_result ($a) { mysqli_stmt_free_result($a); }
    function mysql_select_db ($a,$b) { mysqli_select_db($b,$a); }
}

?>

Ho usato il codice sopra per migrare rapidamente alcuni vecchi script sporchi con molti mysql_query al loro interno. Poiché hai abilitato l'estensione mysqli nel tuo file ini, dovrebbe funzionare anche per te.