Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!Doctype Html>
- <html>
- <head>
- <title>Strona</title>
- <meta charset="UTF-8"/>
- <link rel="stylesheet" type="text/css" href="wzrs.css">
- </head>
- <body>
- <div id="banner">
- <p>wypozyczalnia</p>
- </div>
- <div id="lewy">
- <center><p><a href="index.php">MENU</a></p></center>
- <ol type="a">
- <li><a href="klienci.php">Klienci</a><br></li>
- <li><a href="filmy.php">Filmy</a></li>
- <li><a href="wypozyczenia.php">wypozyczenia</a></li>
- </ol>
- </div>
- <div id="center">
- <?
- error_reporting(E_ALL ^ E_NOTICE);
- ?>
- <?php
- $tab = file('klienci.txt');
- $n = count($tab);
- $rekordy='';
- for ($i = 0; $i < $n; $i++) {
- $l = explode("\t", $tab[$i]);
- $rekordy.="(".trim($l[0]).",'".trim($l[1])."','".trim($l[2])."')";
- if($i<$n-1) $rekordy.=",";
- }
- $rekordy.=";";
- $servername='localhost';
- $login='root';
- $password='';
- $db='vod';
- $conn=mysqli_connect($servername,$login,$password,$db);
- if($conn){
- echo "polaczono z baza danych <br>";
- }
- else
- {
- die("blad polaczenia".mysqli_connect_error ());
- }
- $sql="INSERT into klienci (Pesel, Imie, Nazwisko) VALUES ".$rekordy;
- mysqli_multi_query($conn, $sql);
- ?>
- </div>
- <div id="down">
- <center><p> </p></center>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement