Thread: Sql and php
View Single Post
Old 11-08-2009, 08:19 AM   #1 (permalink)
jnich104
Monkey N00B
 
jnich104's Avatar
 
Join Date: Jun 2008
Location: Nailsea
Posts: 107
jnich104 is on a distinguished road
Send a message via MSN to jnich104
Sql and php

Hey guys, i am creating a new script for my site and i am getting a error but i cant see where it is, and my MySQL looks right

Code
PHP Code:
if($_GET['page'] == 'login')
    {
        
$CONNECT mysql_connect($DB_IP,$DB_USER,$DB_PASS);
            if(!
$CONNECT)
                {
                    die(
'MySQL Error : '.mysql_error());
                }
        
mysql_select_db($DB_NAME$CONNECT);

        
$RESULT mysql_query("SELECT * FROM ".$PREFIX."accounts WHERE username='".$_POST['username']."");
        
$RESULTB mysql_query("SELECT * FROM ".$PREFIX."accounts WHERE username='".$_POST['username']." AND password=".md5($_POST['password'])."");
        while(
$row mysql_fetch_array($RESULT))
          {
            
            
             while(
$rowb mysql_fetch_array($RESULTB))
              {
                   
session_regenerate_id();
                  
$_SESSION['HEWP_MEMBER_ID'] = $rowb['user_id'];
                  
$_SESSION['HEWP_FIRSTNAME'] = $rowb['user_firstname'];
                  
header('location: index.php');
              }
                  else
              {
                  
session_regenerate_id();
                
$_SESSION['HEWP_ERROR'] = 'Password was wrong';
                
header('location: login.fun.php');
              }
          } 
              else 
         {
              
session_regenerate_id();
              
$_SESSION['HEWP_ERROR'] = 'Username was wrong';
              
header('location: login.fun.php');
          }
        
mysql_close($CONNECT);
        
    } 

Error
PHP Code:
Parse errorparse error in C:wampwwwfunctions.php on line 30 

Line 30 :
PHP Code:
}
/* ->  */ else 

Any ideas
__________________
Jamie Nicholls - Feel Free To Ask Questions
jnich104 is offline   Reply With Quote