perché fai:
$id = array();
$id = (int)$id;
????
devi solo fare $id = array();
perché fai:
$id = array();
$id = (int)$id;
????
devi solo fare $id = array();
Jamie Ynonan - Web Developer / Desarrollador Web - HTML5 - CSS3 - Javascript/jQuery - PHP/CodeIgniter/Laravel - SQL/MySQL - Wordpress
Telelavoro / Teleworking - jamiea31[at]gmail.com - Lima - Perù - GMT -5
la linea 55 è questa:
$id[] = $record["ID_Cliente"];
la 75 era un mio precedente esperimento da non tener conto...
$id = array();
$id = (int)$id;
while($record = mysql_fetch_array($RS_posizione)) {
$id[] = $record["ID_Cliente"];
}
while($record = mysql_fetch_array($rs_categoria)) {
$id[] = $record["ID_Cliente"];
}
puoi postare tutto il codice (anche query) indicando le linee 52 e la 55...
Jamie Ynonan - Web Developer / Desarrollador Web - HTML5 - CSS3 - Javascript/jQuery - PHP/CodeIgniter/Laravel - SQL/MySQL - Wordpress
Telelavoro / Teleworking - jamiea31[at]gmail.com - Lima - Perù - GMT -5
Residui di vecchi esperimenti. In ogi caso togliendo $id = (int)$id; mi da questo errore:
Notice: Array to string conversion in C:\Program Files\xampp\htdocs\Zotti\r2.php on line 59
Unknown column 'Array' in 'where clause'
dove alla riga 59 c'è :
$query_rs_ricerca_relazione = "SELECT anagrafica.Nome_Azienda, anagrafica.Nazione, contatti.Cognome, contatti.Nome, contatti.Mail, anagrafica.ID_Cliente FROM anagrafica, contatti WHERE contatti.ID_Cliente = anagrafica.ID_Cliente AND contatti.ID_Cliente IN ($id)";
<?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_my_zotti, $my_zotti);
$query_RS_posizione = "SELECT * FROM contatti";
$RS_posizione = mysql_query($query_RS_posizione, $my_zotti) or die(mysql_error());
$row_RS_posizione = mysql_fetch_assoc($RS_posizione);
$totalRows_RS_posizione = mysql_num_rows($RS_posizione);
mysql_select_db($database_my_zotti, $my_zotti);
$query_rs_categoria = "SELECT * FROM valutazione";
$rs_categoria = mysql_query($query_rs_categoria, $my_zotti) or die(mysql_error());
$row_rs_categoria = mysql_fetch_assoc($rs_categoria);
$totalRows_rs_categoria = mysql_num_rows($rs_categoria);
?>
<?php
$id = array();
$id = (int)$id;
while($record = mysql_fetch_array($RS_posizione)) {
$id[] = $record["ID_Cliente"];
}
while($record = mysql_fetch_array($rs_categoria)) {
$id[] = $record["ID_Cliente"];
}
?>
<?php
mysql_select_db($database_my_zotti, $my_zotti);
$query_rs_ricerca_relazione = "SELECT anagrafica.Nome_Azienda, anagrafica.Nazione, contatti.Cognome, contatti.Nome, contatti.Mail, anagrafica.ID_Cliente FROM anagrafica, contatti WHERE contatti.ID_Cliente = anagrafica.ID_Cliente AND contatti.ID_Cliente IN ($id)";
$rs_ricerca_relazione = mysql_query($query_rs_ricerca_relazione, $my_zotti) or die(mysql_error());
$row_rs_ricerca_relazione = mysql_fetch_assoc($rs_ricerca_relazione);
$totalRows_rs_ricerca_relazione = mysql_num_rows($rs_ricerca_relazione);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento senza titolo</title>
</head>
<body>
</body>
</html>
<?php
mysql_free_result($RS_posizione);
mysql_free_result($rs_categoria);
mysql_free_result($rs_ricerca_relazione);
?>
il problema dovrebbe essere:
$id = array();
$id = (int)$id;
devi fare solo: $id = array();
Jamie Ynonan - Web Developer / Desarrollador Web - HTML5 - CSS3 - Javascript/jQuery - PHP/CodeIgniter/Laravel - SQL/MySQL - Wordpress
Telelavoro / Teleworking - jamiea31[at]gmail.com - Lima - Perù - GMT -5
Ovviamente, dato che $id è un array!
"Mai discutere con un idiota. Ti trascina al suo livello e ti batte con l'esperienza." (Oscar Wilde)
quindi? nessuna soluzione?
Mica puoi concatenare ad una stringa un array così com'è! Devi estarpolarne i vari elementi.
"Mai discutere con un idiota. Ti trascina al suo livello e ti batte con l'esperienza." (Oscar Wilde)