1 Reply Latest reply: Apr 18, 2012 7:05 AM by Ben Pleysier RSS

    Why is the name not being displayed?

    mikeavery333123

      I am trying to display the firstname from my mysql database after someone has logged in. It was working earlier but my login seemed to only be working 50% of the time. It now works 100% but does not display a name like "Welcome, Mike" like I want it to, it just says "Welcome, "

       

      Any help would be great.

       

       

      <<<<<<<<<CODE>>>>>>>>

       

      ...

       

       

      <li style="color:white;">Welcome,

       

                                                                  <?php

                              // Connect to database server

                              include_once '../../mysql_server/connect_to_mysql.php';

       

                                                                  error_reporting(E_ALL);

                                                                  ini_set('display_errors', '1');

       

       

                                    $id = isset($_SESSION['id']);

                              // SQL query

                              $strSQL = "SELECT * FROM myMembers WHERE ID = '$id'";

                         

                              // Execute the query (the recordset $rs contains the result)

                              $rs = mysql_query($strSQL);

                             

                              // Loop the recordset $rs

                              // Each row will be made into an array ($row) using mysql_fetch_array

                              while($row = mysql_fetch_array($rs)) {

                         

                                 // Write the value of the column FirstName (which is now in the array $row)

                               echo $row['firstname'];

                         

                                }

                         

                              // Close the database connection

                              mysql_close();

                              ?>

           

                      </li>

                      <li><a href="../../logout.php">Logout</a></li>

       

       

      <<<<<<CODE>>>>>>>>>