Hi, I'm working with mysql 5 with improved extensions (mysqli) and php5. I need mysqli homologe functions to mysql_num_fields, mysql_field_name and mysql_result. I was looking for those in the official manual but I didn't find anything, so I changed to mysql function, but I obtained the next error:
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /var/www/nomina/everdeptosall.php on line 16
The code is the next:
$conn=mysql_connect($host, $user, $password) or die("No se pudo establecer comunicacion");
$db=mysql_select_db($conn, $basedatos) or die("Error en la base de datos");
$sql="SELECT id, nombres, apellidos, nivacad, depto FROM empleados ORDER BY depto";
$ersdepall=mysql_query($conn, $sql) or die(mysql_error($conn));
$efilas=mysql_num_fields($ersdepall);
The line 16 that errors match is:
$db=mysql_select_db($conn, $basedatos) or die("Error en la base de datos");
So, my question is: why am I getting this error? Can't use mysql functions instead of mysqli functions?
Do you know some homologe mysqli functions to mysql_num_fields, mysql_field_name and mysql_result?
Thanks for your help
Tamayo