title: Stripslahes function not working, value missing text after strings contating " ' " in them
body: <p>So as the titles says, any strings which contain ' in them are not showing up properly in the website page itself. Anything after the ' is blank but anything before the ' is shown. But if I go to the database and view the information there, the word shows perfectly.</p>
  
  <p>When I am putting the string values into the database, I use <em>mysqli_real_escape_string</em> before inserting them. And I have an option on the website to update these values by bringing them back and putting them into a text box but that is where anything after ' is blank.</p>
  
  <p>Exampe: O' Rourke
  -> Would come back as: O</p>
  
  <p>All code below. Deals with customers.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
  
      &lt;title&gt;MindFactory - Performance For Less&lt;/title&gt;
  
      &lt;link rel="stylesheet" type="text/css" href="global.css"&gt;
  
  &lt;/head&gt;
  
  &lt;body id = "container"&gt;
  
  &lt;!-- --------------------------- Creating The Menu Bar ----------------------------------- --&gt;
  
      &lt;ul class = "menuBar"&gt;
          &lt;li&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class = "active" href="customer.php"&gt;Customer&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="sales.php"&gt;Sales&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="http://www.example.com"&gt;User: Administrator&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
      &lt;div class = "products"&gt;
  
      &lt;!-- -------------------------- HEADING --------------------- --&gt;
  
          &lt;h1&gt;Register a Customer&lt;/h1&gt;
  
          &lt;div id = "inputFormat"&gt;
  
              &lt;form method="post" action="customer.php"&gt;
                  &lt;label&gt;Email: *
                      &lt;input type="text" name="email" placeholder="Enter Email" /&gt;
                  &lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;First Name: *
                      &lt;input type="text" name="forename" placeholder="Enter First Name" /&gt;
                  &lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;Last Name: *
                      &lt;input type="text" name="surname" placeholder="Enter Last Name" /&gt;
                  &lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;Address: *
                      &lt;input type="text" name="address" placeholder="Enter Address" /&gt;
                  &lt;/label&gt;&lt;br&gt;
  
                  &lt;input type="submit" name="register" value="Register Customer" /&gt;
              &lt;/form&gt;&lt;br&gt;&lt;hr&gt;
  
          &lt;/div&gt;
  
  &lt;?php
  
  // -------------------------------------- WHEN A NEW CUSTOMER IS BEING REGISTERED, DO THIS -----------------------------
  if(isset($_POST['register'])){
      $forename = $_POST['forename'];
      $surname = $_POST['surname'];
      $address = $_POST['address'];
      $email = $_POST['email'];
  
      if($forename == "" OR $surname == "" OR $address == "" OR $email == "") {
          echo("You Did Not Enter All Details&lt;br&gt;&lt;br&gt;");
      }
      else {
          include 'connection.php';
  
          $forenameEsc = mysqli_real_escape_string($connection,$forename);
          $surnameEsc = mysqli_real_escape_string($connection,$surname);
          $addressEsc = mysqli_real_escape_string($connection,$address);
          $emailEsc = mysqli_real_escape_string($connection,$email);
  
          $sql = "INSERT INTO customer(email,forename,surname,address) VALUES('$emailEsc','$forenameEsc','$surnameEsc','$addressEsc')";
  
          $result = mysqli_query($connection,$sql);
  
          if($result == 0) {
              echo("&lt;p&gt;Error Registering: ". mysqli_error($connection) . "&lt;/p&gt;");
          }
          else {
              echo("&lt;br&gt;&lt;strong&gt;Success&lt;/strong&gt;. User: " . $forename . " " . $surname . " Has Been Registered");
          }
      }
  }
  
  // ---------------------------------------- WHEN NO CUSTOMER HAS BEEN CHOSEN TO UPDATE ------------------------------
  
  if(!isset($_POST['update']) AND !isset($_POST['delete'])) {
  
  include 'connection.php';
  
  $statement = "SELECT * FROM customer";
  
  $result = mysqli_query($connection, $statement);
  
  if(!$result) {
  echo "Query One Failed";
  exit();
  }
  else {
  if(mysqli_num_rows($result) &lt; 1) {
  echo "No Users Created";
  }
  else {
      echo "&lt;h1&gt;Update or Delete a Customer&lt;/h1&gt;";
  
      echo "&lt;table border=1&gt;";
      echo "&lt;tr&gt;&lt;th&gt;Customer ID&lt;/th&gt;&lt;th&gt;Email&lt;/th&gt;&lt;th&gt;First Name&lt;/th&gt;&lt;th&gt;Second Name&lt;/th&gt;&lt;th&gt;Address&lt;/th&gt;&lt;th&gt;Update&lt;/th&gt;&lt;th&gt;Delete&lt;/th&gt;&lt;/tr&gt;";
      while ($row = mysqli_fetch_array($result)) {
          $custID = $row['custID'];
      echo ("&lt;tr&gt;&lt;td&gt;");
              echo $custID;
              echo("&lt;/td&gt;&lt;td&gt;");
              echo $row['email'];
              echo("&lt;/td&gt;&lt;td&gt;");
              echo $row['forename'];
              echo("&lt;/td&gt;&lt;td&gt;");
              echo $row['surname'];
              echo("&lt;/td&gt;&lt;td&gt;");
              echo $row['address'];
              echo("&lt;/td&gt;&lt;td&gt;");
              echo("&lt;form method='post' action='customer.php'&gt;&lt;input type='hidden' name='custID' value='$custID'/&gt;&lt;input type='submit' name='update' value='Update This User' /&gt;&lt;/form&gt;");
              echo("&lt;/td&gt;&lt;td&gt;");
              echo("&lt;form method='post' action='customer.php'&gt;&lt;input type='hidden' name='custID' value='$custID'/&gt;&lt;input type='submit' name='delete' value='Delete This User' /&gt;&lt;/form&gt;");
              echo("&lt;/td&gt;&lt;/tr&gt;");
      }
      echo "&lt;/table&gt;";
      }
  }
  mysqli_free_result($result);
  mysqli_close($connection);
  
  }
  
  // ---------------------------------------- WHEN USER TO UPDATE IS CHOSEN, DISPLAY THIS ------------------------------
  
  if(isset($_POST['update'])) {
  $custID = (int) $_POST['custID'];
  
  include 'connection.php';
  
  $statement = "SELECT * FROM customer WHERE custID = $custID";
  
  $result = mysqli_query($connection,$statement);
  
  if(!$result) {
  echo "Query Failed";
  exit();
  }
  
  else {
  $row = mysqli_fetch_array($result);
  $firstName = $row['forename'];
  $lastName = $row['surname'];
  $address = $row['address'];
  
  $sFirstName = stripslashes($firstName);
  $sLastName = stripslashes($lastName);
  $sAddress = stripslashes($address);
  
  echo ("
  &lt;form method='post' action = 'customer.php'&gt;
      &lt;label&gt;New Forename: &lt;br&gt;
          &lt;input type='text' name='ud_forename' value='$sFirstName' /&gt;
      &lt;/label&gt;&lt;br&gt;
  
      &lt;label&gt;New Surname: &lt;br&gt;
          &lt;input type='text' name='ud_surname' value='$sLastName' /&gt;
      &lt;/label&gt;&lt;br&gt;
  
      &lt;label&gt;New Address: &lt;br&gt;
          &lt;input type='text' name='ud_address' value='$sAddress' /&gt;
      &lt;/label&gt;&lt;br&gt;&lt;br&gt;
  
      &lt;input type='hidden' name='userToUpdate' value='$custID' /&gt;
  
      &lt;input type='submit' name='user_update' value='Confirm Changes' /&gt;
  &lt;/form&gt;");
  
  }
  mysqli_free_result($result);
  mysqli_close($connection);
  }
  
  // ------------------------------ WHEN USER ENTERS THE NEW VALUES, DO THIS ----------------------------------
  if(isset($_POST['user_update'])) {
      include 'connection.php';
  
      $updatedForename = $_POST['ud_forename'];
      $updatedSurname = $_POST['ud_surname'];
      $updatedAddress = $_POST['ud_address'];
      $userToUpdate = (int) $_POST['userToUpdate'];
  
      if($updatedForename == '' OR $updatedSurname == '' OR $updatedAddress == '') {
          echo "&lt;br&gt;Missing Information. Please Try Again";
          exit();
      }
  
      $updatedForenameEsc = mysqli_real_escape_string($connection,$updatedForename);
      $updatedSurnameEsc = mysqli_real_escape_string($connection,$updatedSurname);
      $updatedAddressEsc = mysqli_real_escape_string($connection,$updatedAddress);
  
      $statement = "UPDATE customer SET forename = '$updatedForenameEsc', surname = '$updatedSurnameEsc', address = '$updatedAddressEsc' WHERE custID = $userToUpdate";
  
      $result = mysqli_query($connection,$statement);
  
      if(!$result) {
          echo "Query Failed";
          exit();
      }
  
      else {
          if(mysqli_affected_rows($connection) &lt; 1) {
              echo "No Updates Made";
          }
          else {
              echo ("&lt;br&gt;Customer ID Number: " . $userToUpdate . " Updated");
              mysqli_close($connection);
          }
      }
  }
  
  // ---------------------------------- WHEN A CUSTOMER IS CHOSEN TO DELETE --------------------------------------
  
  if(isset($_POST['delete'])) {
      include 'connection.php';
  
      $userToDelete = (int) $_POST['custID'];
  
      $statement = "DELETE FROM customer WHERE custID = $userToDelete";
  
      $result = mysqli_query($connection,$statement);
  
      if(!$result) {
          echo "Query Failed - " . mysqli_error($connection);
          echo "&lt;br&gt;&lt;br&gt;&lt;strong&gt;Error: &lt;/strong&gt;Customer Exists In A Sale";
          exit();
      }
  
      else {
          if(mysqli_affected_rows($connection) &lt; 1) {
              echo "No Deletion Made";
          }
          else {
              echo ("&lt;br&gt;Customer ID Number: " . $userToDelete . " Deleted");
              mysqli_close($connection);
          }
      }
  }
  
  ?&gt;
  
      &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>