salve ho problemi con la query; in pratica non capisco perchè riesce a leggere e stampare a video nome e cognome ma l'id non riesce a trovarlo chi puo auitarmi?? (credo che il problema sia nella query)
Codice PHP:
<!DOCTYPE html>
<html>
<?php
$username="dechiarap";
$password="*****";
$database="my_dechiarap";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Impossibile selezionare il database.");
include("connessioneDB.php");
extract($_GET);
$id = $_GET['id'];
$query="select * from clienti where clienti.id= '$id'";
$result = mysql_query($query);
$nome=mysql_result($result,"nome");
$array=mysql_fetch_array($result);
?>
<head>
<meta charset="UTF-8">
<title>QRFit</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="mobile portfolio, mobile portfolio site">
<meta name="author" content="sam deering">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/jquery.mobile-1.2.0.min.js"></script>
<link href="css/jquery.mobile.structure-1.2.0.min.css" rel="stylesheet">
<link href="css/jquery.mobile.theme-1.2.0.min.css" rel="stylesheet">
<link href="css/jquery.mobile-1.2.0.min.css" rel="stylesheet">
<link href="css/photoswipe.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/script.js"></script>
<script src="js/settings.js"></script>
<script src="js/klass.min.js"></script>
<script src="js/code.photoswipe.jquery-3.0.5.min.js"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<div data-role="page" id="bar" data-title="modifica cliente">
<div data-role="header" data-position="fixed" data-theme="a">
<h1>QRFIT</h1>
<div class="ui-btn-left" data-role="controlgroup" data-type="horizontal"/>
<a href="home_good.php" data-role="button" data-icon="home">home</a>
<a data-role="button" data-rel="back" data-icon="back" data-direction="reverse">Indietro</a>
</div>
<a href="login.php?status=loggedout" data-role="button" class="ui-btn-right" >Logout</a>
</div>
<?php
?>
<div data-role="content">
<h2 align="center">VISUALIZZA CLIENTE</h2>
<p align="center">
<img src="<?php echo $array["immagine"]?>" width=\"150\" height=\"150\"></p>
<p align="center">ID
<input type="text" readonly name="cognome" style="width:20%;" id="cognome" value=<?php echo $array["id"]?>> </p>
<p align="center">Nome
<input type="text" readonly name="nome" style="width:20%;" id="nome" value=<?php echo "$nome"?>> </p>
<p align="center">Cognome
<input type="text" readonly name="cognome" style="width:20%;" id="cognome" value=<?php echo $array["cognome"]?>> </p>
<p align="center">Sesso
<input type="text" readonly name="eta" style="width:20%;" id="eta" value=<?php
if($array["sesso"]==0)echo "M";
else echo "F";?>> </p>
<p align="center">Età
<input type="text" readonly name="eta" style="width:20%;" id="eta" value=<?php echo $array["eta"]?>> </p>
<p align="center">Peso(Kg)
<input type="text" readonly name="peso" style="width:20%;" id="peso" value=<?php echo $array["peso"]?>> </p>
<p align="center">Altezza(cm)
<input type="text" readonly name="altezza" style="width:20%;" id="altezza" value=<?php echo $array["altezza"]?>> </p>
<p align="center">Annotazioni
<input type="text" readonly name="annotazioni" style="width:20%;" id="cognome" value=<?php echo $array["annotazioni"]?>> </p>
<p align="center">Note
<input type="text" readonly name="cognome" style="width:20%;" id="cognome" value=<?php echo $array["note"]?>> </p>
<p align="center">Data Iscrizione
<input type="text" readonly name="data_iscr" style="width:20%;" id="cognome" value=<?php echo $array["data_iscrizione"]?>> </p>
<p align="center">Scadenza Abbonamento<input type="text" readonly name="scadenza_abbonamento" style=" width:20%;" id="cognome" value=<?php echo $array["scadenza_abbonamento"]?>> </p>
<p>
<?php
include("connessioneDB.php");
echo "<p img src=\"immagini/seleziona.png\" border=0 align='center' >
<a href='vedi_schede.php?id=$array[id]'data-role='button' style='width:50%' ><img src=\"immagini/seleziona.png\" border=0> Schede</center></a>
<a href='mod_clienti.php?id=$array[id]'data-role='button' data-icon='gear' style='width:50%' >Modifica</center></a>
</p>
<p align='center' > <a href='sel_clienti.php?op=del&id=$array[id]' onclick=\"return(confirm('Sei sicuro di voler cancellare??'))\" data-role='button' data-icon='delete' style='width:50%' > Elimina</center></a> </p> "
?>
</div>
<div data-role="footer">
<h4></h4>
</div>
</div><!-- /page -->
</body>
</html>
<?php
include("connessioneDB.php");
if (isset($_GET['op'])=="del"){
$id=$_GET['id'];
$dati=mysql_query("delete from clienti where id='$id'");
if($dati) echo "cancellato correttamente";
else echo "non stato cancellato per motivi tecnici: ".mysql_error();
echo"<script language=javascript>";
echo"document.location.href='sel_clienti.php'";
echo"</script>";
}
?>