Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL und Perl

Empfohlene Antworten

Veröffentlicht

Hallo,

ich suche Beispiele, wie ich eine MySQL Datenbank mit perl abfragen kann. Kann mir eine dabei helfen ???

Zum Beispiel von localhost

SELECT * FROM test;

:-)

Hallo,

das geht mit den Modulen DBI und DBD-Mysql.

Wie du die unter Linux bekommst oder ob sie schon automatisch dabei sind, kann ich dir nicht sagen, da ich Windows habe.


use DBI;


$driver = "mysql";

$database = "mysql";

$hostname = "localhost";

$dsn = "DBI:$driver:database=$database;host=$hostname";

$user = "pille";

$password = "palle";


$dbh= DBI->connect("$dsn","$user","$password") || die "Got error $DBI::errstr when connecting to $dsn\n";


$statement = "select * from user";

$sth = $dbh->prepare($statement);

$sth->execute() or die("Couldn't perform query: $!");


while ($ref = $sth->fetchrow_hashref()) 

{

	$sURL = $ref->{'User'};

	print $sURL;

}

$sth->finish;

alles weitere steht in den Manuals der Module.

Gruß Jaraz

Das MySQL Datenbankhandbuch gelesen zu haben kann nie schaden.

Desweiteren findest du hier die Syntax dazu.

Ich hoffe das hilft dir weiter.

Redfox

Ich schiebs mal zur Webserverprogrammierung rüber, hat ja eher weniger mit Linux selber zu tun...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.