non capisco bene la sintassi che devo inserire nei vari casi del switch.
nel mio caso ho questi script:
script1.php
codice:
<?php
include ("config.php");
$result = mysql_query("SELECT * FROM users ORDER BY CAST(username AS DATE)") or die(mysql_error());
while($row = mysql_fetch_array( $result ))
{
echo "<table width='100%' border='1'>";
echo"<tr>";
echo "<th width='10%'>Utente</th>";
echo"<td>";
echo $row['username'];
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<th width='10%'>Email</th>";
echo"<td>";
echo $row['email'];
echo"</td>";
echo"</tr>";
echo"</table>";
echo"
";
}
?>
script2.php
codice:
<?php
include ("config.php");
$result = mysql_query("SELECT * FROM users ORDER BY CAST(articolo AS DATE)") or die(mysql_error());
while($row = mysql_fetch_array( $result ))
{
echo "<table width='100%' border='1'>";
echo"<tr>";
echo "<th width='10%'>articolo</th>";
echo"<td>";
echo $row['articolo'];
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<th width='10%'>prezzo</th>";
echo"<td>";
echo $row['prezzo'];
echo"</td>";
echo"</tr>";
echo"</table>";
echo"
";
}
?>
quindi come faccio a richiamare questi miei 2 script nei case del switch?
codice:
case 1: //il codice per generare il contenuto di "chi siamo"
$contenuto = //... il codice generato qui sopra
break;