我无法弄清楚我的 phpscript 的这一部分有什么问题。登录成功,但我无法从正确的帐户检索数据。谁能看看这部分脚本是否有问题?
$_SESSION['ingelogd'] = true;
$_SESSION['profiel'] = $rij['Type'];
$_SESSION['gebruikerID'] = $rij ['Account_nr'];
// Gebruiker succesvol ingelogd, gegevens opslaan in sessie enzo ...
if(strcmp($rij['Type'],"bedrijf")==0){
$query2 = "SELECT * FROM account_bedrijf WHERE Account_nr = '" . $_SESSION['gebruikerID'] . "limit 1' ";
$result2 = mysql_query( $query2 ) or trigger_error( mysql_error() );
if( mysql_num_rows( $result2 ) == 0 ) {
session_unset();
echo 'Ongeldige gebruikersnaam en/of wachtwoord';
} else {
$_SESSION['company'] = $result->Bedrijf_nr;
header( 'Location: company_profile.php' ) ;