1 Reply Latest reply on Apr 18, 2012 7:05 AM by BenPleysier

    Why is the name not being displayed?


      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.








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



                              // Connect to database server

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



                                                                  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





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