Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/11/2015, 12:57
packvt21
 
Fecha de Ingreso: noviembre-2015
Mensajes: 4
Antigüedad: 8 años, 5 meses
Puntos: 0
Error: mysql_select_db() expects parameter 2 to be resource, object given

Que tal buenas tardes alguien podria ayudarme a descubrir cual es mi error por favor.


<?php require_once('Connections/conexion.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_conexion, $conexion);
$query_rsNombres = "SELECT * FROM cliente ORDER BY cliente.nombre";
$rsNombres = mysql_query($query_rsNombres, $conexion) or die(mysql_error());
$row_rsNombres = mysqli_fetch_assoc($rsNombres);
$totalRows_rsNombres = mysql_num_rows($rsNombres);
?>
<table width="371" border="1">
<tr>
<th width="55" bgcolor="#666666" scope="col">id_clave</th>
<th width="50" bgcolor="#666666" scope="col">nombre</th>
<th width="56" bgcolor="#666666" scope="col">apellido paterno</th>
<th width="56" bgcolor="#666666" scope="col">apellido materno</th>
<th width="60" bgcolor="#666666" scope="col">direccion</th>
<th width="54" bgcolor="#666666" scope="col">telefono</th>
</tr>
<tr>
<td><?php echo $row_rsNombres['id_cliente']; ?></td>
<td><?php echo $row_rsNombres['nombre']; ?></td>
<td><?php echo $row_rsNombres['ap']; ?></td>
<td><?php echo $row_rsNombres['am']; ?></td>
<td><?php echo $row_rsNombres['direccion']; ?></td>
<td><?php echo $row_rsNombres['telefono']; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>



Y esta es el codigo de conexion.

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_conexion = "localhost";
$database_conexion = "zapateria";
$username_conexion = "root";
$password_conexion = "";
$conexion = mysqli_connect($hostname_conexion, $username_conexion, $password_conexion) or trigger_error(mysql_error(),E_USER_ERROR);
?>