juego de registro
Publicado por veronica (1 intervención) el 22/07/2014 21:02:17
buen dia tengo un problema grave con el dreamweaver
inserto un juego de registros todo marcha bien pero me salen 2 errores:
Warning: mysql_select_db() expects parameter 2 to be resource, object given in C:\server\Web\damasco\cliente.php on line 34
Warning: mysql_query() expects parameter 2 to be resource, object given in C:\server\Web\damasco\cliente.php on line 36
aqui el codigo:
cuando modifico el mysql por mysqli el juego de registro desaparece... a que se debe? debo usar una version anterior de php?
inserto un juego de registros todo marcha bien pero me salen 2 errores:
Warning: mysql_select_db() expects parameter 2 to be resource, object given in C:\server\Web\damasco\cliente.php on line 34
Warning: mysql_query() expects parameter 2 to be resource, object given in C:\server\Web\damasco\cliente.php on line 36
aqui el codigo:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php require_once('Connections/link.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_link, $link);
$query_Recordset1 = "SELECT * FROM productos";
$Recordset1 = mysql_query($query_Recordset1, $link) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
mysql_free_result($Recordset1);
?>
cuando modifico el mysql por mysqli el juego de registro desaparece... a que se debe? debo usar una version anterior de php?
Valora esta pregunta


-1