troubleshooting Question

Sql connection

Avatar of breeze351
breeze351 asked on
PHP
6 Comments1 Solution181 ViewsLast Modified:
I'm having a brain cramp today.  I can't see what's wrong with the following connection code:

// Check to see if this it the orignal connection to the database
      if (!isset($_SESSION['Local_Name']))
            {
                  $conn = mysql_connect('localhost', 'langsyst_glenn', 'Zaq12wsX#');
                  // Select data base        
                  $db_selected = mysql_select_db('langsyst', $conn);
            if (!$db_selected)
                        {
                      die ('Can\'t use foo : ' . mysql_error());
                        }
                  $SqlString = "SELECT * FROM Default_Login WHERE NAME = 'glenn351' and PASSWORD = 'Zaq12wsX#'";

                  $Query = $SqlString;
                  $User_File = mysql_query($SqlString,$conn);
            //Initialize session variables
                  $ROW=mysql_fetch_array($User_File, MYSQL_BOTH);
                  $_SESSION['Local_Name'] = $ROW["Local_Name"];
                  $_SESSION['Local_Password'] = $ROW["Local_Password"];                  
            }
      echo $_SESSION['Local_Name'];
      echo "<br>";
      echo $_SESSION['Local_Password'];
      echo "<br><br>";

It keeps dieing on the "Foo" line.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros