19/05/2023: A causa di un errore sono stati cancellati, insieme ad account creati da bot, alcuni account legittimi. Si prega di leggere qui: https://www.gambas-it.org/smf/index.php?topic=9733.0
PUBLIC $Con AS NEW ConnectionPUBLIC SUB _new()ENDPUBLIC SUB Form_Open()ENDPUBLIC PROCEDURE Connect() $Con.Close() ' Close the connection $Con.Type = "MySQL" ' Type of connection $Con.Host = "localhost" ' Name of the server $Con.Login = "root" ' User's name for the connection $Con.Port = "3306" ' Port to use in the connection, usually 3306 $Con.Name = "prova" ' Name of the data base we want to use $Con.Password = "123" ' User's password $Con.Open() ' Open the connectionENDPUBLIC SUB ToggleButton1_Click() DIM $Query AS String DIM $Result AS Result DIM $Phone AS String Connect() $Query = "SELECT * FROM domini" $Result = FMain.$Con.Exec($Query) $Phone = $Result!$Phone Message.Info($Phone)END
$Result = FMain.$Con.Exec($Query)IF $Result.Available THEN $Phone = $Result!$Phone Message.Info($Phone)ELSE Message.Warning("Nessun risultato")ENDIF
$Con.Host = "localhost" ' Name of the server
$/etc/init.d/mysql restart