Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $server_username = "root";
- $server_password = "";
- $dbName = "test";
- //$username = $_POST["usernamePost"];
- //Make Connection
- $conn = new mysqli($servername, $server_username,$server_password,$dbName);
- //Check Connection
- if(!$conn)
- {
- die("Connection Failed.". mysql_connect_error());
- }
- $sql = "SELECT characterName WHERE username = ' 'Bob'";
- $result = mysqli_query($conn,$sql);
- if(!$result)
- {
- echo "Failed to grab data";
- }
- if(mysqli_num_rows($result) > 0)
- {
- echo $result;
- while($row = mysqli_fetch_assoc($result))
- {
- echo "characterName:".$row['characterName'].";";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement