FAQ - Come faccio a stampare tutti i campi ed i risultati di una tabella in PHP?
<?php
$query="select * from nometabella";
$risultato= @mysql_query($query);
$numcampi = @mysql_num_fields($risultato);
echo "<table><tr>";
for ($i=0; $i < $numcampi; $i++)
{
echo '<th>'.mysql_field_name($risultato, $i).'</th>';
}
echo "</tr>";
while ($row = @mysql_fetch_row($risultato))
{
echo '<tr><td>'.implode($row,'</td><td>')."</td></tr>";
}
echo "</table>";
?>
Come si può creare un database MySQL in PHP?
Per creare un database MySQL tramite uno script in PHP basta semplicemente seguire l'esempio riportato di seguito, è chiaro che per andare a buon fine...
Come eliminare un file in PHP?
Per eliminare un file in PHP basta usare l'istruzione unlink abbinati ad i permessi di scrittura, di seguito l'esempio.
<?php
@unlink("percorso/cartella/sottocartella/mio-file.php");
?>
Cosa è MySQL?
MySQL è un software DBMS (Database Managment System) open source ideato per consentire la gestione e la manipolazione dei dati sia in ambiente UNIX che...
Come si effettua un redirect in PHP?
Per effettuare un redirect in PHP basta fare riferimento al codice riportato in basso.
<?php
@header("Location: http://www.esempio.it");
?>


©