Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost:8889";
- $username = "root";
- $password = "root";
- $dbname = "Forms";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql1 = "INSERT INTO Users1 (username, password, firstname, surname, address, postcode, email, phone, birthday, birthmonth, birthyear, gender)
- VALUES ('$_POST[username]','$_POST[password]','$_POST[firstname]','$_POST[surname]','$_POST[address]','$_POST[postcode]','$_POST[email]','$_POST[phone]','$_POST[birthday]','$_POST[birthmonth]','$_POST[birthyear]','$_POST[gender]')";
- $sql2 = "INSERT INTO Currencies1 (email, camount, currency)
- VALUES ('$_POST[email]','$_POST[camount]','$_POST[currency]')";
- // First connection for user data
- if ($conn->query($sql1) === TRUE) {
- echo "Victorrry!";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- // Second connection for currencies
- if ($conn->query($sql2) === TRUE) {
- echo "";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $chkbox = $_POST['chk'];
- $txtbox = $_POST['camount'];
- $country = $_POST['currency'];
- foreach($txtbox as $a => $b)
- echo "$chkbox[$a] - $camount[$a] - $currency[$a] <br />";
- $conn->close();
- ?>
- <?php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement