Un affettuoso saluto a tutti, è la prima volta che vengo in questo forum.
Allora in pratica ho creato:
un database in mysql che si chiama province e una tabella che si chiama rubrica così popolata
id Nome Cognome Indirizzo
1 Mauro Pinto Via Roma 1
2 Stefano Benni Via sport 2
3 Vito Penna Via Est 12
4 Nico Uva Via Papagni 7
5 Mauro Pugliese Via Trieste 8
6 Mauro Pinto Via Roma 15
in locale il codice postato mi stampa a video tutti i dati della tabella in modo perfetto così come si vede. Sto impazzendo perchè non riesco a capire come si fa un menù a tendina con il Nome,Cognome, Indirizzo in cui il navigatore scegliendo una di queste voci possa ottenere la stampa a video come la ottengo io in locale.
Spero tanto un vostro aiuto a presto
ECCO IL CODICE
<?php require_once('../Connections/mysql_connect.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_mysql_connect, $mysql_connect);
$query_Recordset1 = "SELECT Indirizzo FROM rubrica ORDER BY Indirizzo ASC";
$Recordset1 = mysql_query($query_Recordset1, $mysql_connect) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_mysql_connect, $mysql_connect);
$query_Recordset1 = "SELECT * FROM rubrica ";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $mysql_connect) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<!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>
<table>
<tr>
<td>Id</td>
<td>Nome</td>
<td>Cognome</td>
<td>Indirizzo</td>
</tr>
<?php do { ?><tr></tr>
<tr>
<td><?php echo $row_Recordset1['Id']; ?></td>
<td><?php echo $row_Recordset1['Nome']; ?></td>
<td><?php echo $row_Recordset1['Cognome']; ?></td>
<td><?php echo $row_Recordset1['Indirizzo']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>