I am trying to get the following page to work properly. I have gotten similar pages to work correctly in the past but they only contained one sql query. Please have a look at the following code and tell me what you think. I have tried to keep the code as simple as possible and am hoping this could just be a basic syntax error. Thank You
<?php
session_start();
$servername = "localhost";
$username = "digita86_Hyperius";
$password = "5xtc55xtc!";
$dbname = "digita86_2_cent_rally_db";
$connection = new mysqli($servername, $username, $password, $dbname);
if ($connection->connect_error) {
die("Connection failed: " . $connection->connect_error);
}
$passcodeInput = $_POST['passcode'];
$query = "SELECT * FROM 2_cent_rally_db_table WHERE email='$passcodeInput'";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$count = mysqli_num_rows($result);
if ($count == 1){
$_SESSION['passcode'] = $passcodeInput;
}else{
echo "I'm sorry but the credentials you have submitted do not match our records. Please try again.";
}
?>
<?
$servername = "localhost";
$username = "digita86_Hyperius";
$password = "5xtc55xtc!";
$dbname = "digita86_2_cent_rally_db";
$connectionA = new mysqli($servername, $username, $password, $dbname);
$queryA = "SELECT * FROM 2_cent_rally_db_table WHERE email='$passcodeInput'";
$resultA = mysqli_query($connectionA, $queryA);
$rowA = mysqli_fetch_array($resultA);
$rowA['balance'];
$dicecoinBalance = $rowA['balance'];
echo $dicecoinBalance;
$_SESSION['balance'] = $dicecoinBalance;
if ($connectionA->connect_error) {
die("Connection failed: " . $connectionA->connect_error);
?>
<?
$servername = "localhost";
$username = "digita86_Hyperius";
$password = "5xtc55xtc!";
$dbname = "digita86_2_cent_rally_db";
$connectionB = new mysqli($servername, $username, $password, $dbname);
$queryB = "SELECT * FROM 2_cent_rally_db_table WHERE email='$passcodeInput'";
$resultB = mysqli_query($connectionB, $queryB);
$rowB = mysqli_fetch_array($resultB);
$rowB['stock_value'];
$stockValue = $rowB['stock_value'];
echo $stockValue
$_SESSION['stock_value'] = $stockValue;
if ($connectionB->connect_error) {
die("Connection failed: " . $connectionB->connect_error);
header("Location: 2_cent_rally.php");
$connection->close();
?>