home //

Codici sorgenti PHP

Codici sorgenti in PHP per l'accesso al database MySQL

Ecco un esempio di codice in PHP

<?

   // Nelle variabili sotto riportate, sostituire i valori di db_server, db_database, db_uid, db_pwd
   // con i rispettivi valori che trovi nel tuo pannello di controllo: server, database, username, password

   $db_server = "127.0.0.1" ;
   $db_database = "m1d1" ;
   $db_uid = "m1d1" ;
   $db_pw = "ue72agsx61qasw91" ;

   // Connessione al database
   $link = mysql_connect($db_server,$db_uid,$db_pw);
   mysql_select_db($db_database);

   $result=mysql_query("SELECT nome FROM utenti",$link);
   if ($result)
   {
      while ($row = mysql_fetch_object($result))
      {
         echo ("$row->nome<br />");
      }
   }

   mysql_free_result($result);

?>

Go back

Do you need
technical
assistance?

Our staff is always at your disposal for any queries. Contact us for free and not demanding support.

Contact Contact us
Cookies information
We use cookies to provide our services. By using this site you consent to the use of cookies.
ACCEPT DECLINE DISCLOSURES