Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. include_once ("scripts/connect_to_mysql.php");
  3. include_once ("scripts/checkuserlog.php");
  4.  
  5. if ($_GET['newgame'] == 1)
  6. {
  7.     /// NEW GAME STARTED
  8.  
  9.     $sql = mysql_query("SELECT name, para_1, para_2, gcs, hr, defib_shocks, sats FROM game WHERE mem_id = '{$_SESSION['id2']}'");
  10.  
  11.     while($row = mysql_fetch_array($sql))
  12.     {
  13.  
  14.         $name = $row['name'];
  15.         $CauseOrCondition = $row['para_1'];
  16.         $age = $row['para_2'];
  17.         $gcs = $row['gcs'];
  18.         $hr = $row['hr'];
  19.         $defib_shocks = $row['defib_shocks'];
  20.         $oxSats - $row['sats'];
  21.  
  22.         $name2 = "";
  23.         $sql2 = mysql_query("SELECT * FROM names WHERE id = '$name' LIMIT 1");
  24.         while($row = mysql_fetch_array($sql2))
  25.         {
  26.             $name2 = $row['name'];
  27.  
  28.  
  29.             $heart_status = "";
  30.             if ($hr == 0)
  31.             {
  32.                 $heart_staus = '. No pulse at scene and Resus performed, ' . $defib_shocks . ' Shocks given.';
  33.             }
  34.             else
  35.             {
  36.                 $heart_status = ', Heart Rate ' . $hr . ' and SATs of ' . $oxSats . '%. ';
  37.             }
  38.  
  39.             $msgToUser = ' Hi, this is ' . $name2 . ', ' . $age . ' years old, ' . $CauseOrCondtion . ' ' . $heart_status . '';
  40.         }
  41.     }
  42. }      
  43.  
  44. include_once 'msgToUser.php';
  45. exit();
  46.  
  47. ?>
Add Comment
Please, Sign In to add comment