My PHP Source ============= <?php include('../../tilkobling.php'); $sql = "SELECT kg_pa_lager FROM dynamit WHERE valgt_lager = '$valgt_lager' AND varenr = '$varenr'"; $resultat = mysql_query($sql, $tilkobling) or die(mysql_error()); while($rad = mysql_fetch_array($resultat)){ $kg_pa_lager = $rad['kg_pa_lager']; echo "$kg_pa_lager"; } var_dump($sql); echo "<br />"; var_dump($kg_pa_lager); ?> My var_dump() value; ================== string(84) "SELECT kg_pa_lager FROM dynamit WHERE valgt_lager = 'Tengs' AND varenr = 'EDY22X180'" NULL My Database table: =============== mysql> SELECT * FROM dynamit; +------------+-------------+---------------+--------+-------+----------+------------+-------------+ | leverandor | valgt_lager | type | dim_mm | un_nr | varenavn | varenr | kg_pa_lager | +------------+-------------+---------------+--------+-------+----------+------------+-------------+ | Orica | Tengs | Papirpatroner | 22x180 | 0081 | Dynamit | EDY22X180K | 100 | | Orica | Tengs | Papirpatroner | 25x180 | 0081 | Dynamit | EDY25X180 | 100 | | Orica | Tengs | Plastpølse | 45x540 | 0081 | Dynamit | EDY45X540 | 100 | +------------+-------------+---------------+--------+-------+----------+------------+-------------+ 3 rows in set (0.00 sec) mysql> The Problem: ========== If I do this: $sql = "SELECT kg_pa_lager FROM dynamit WHERE valgt_lager = '$valgt_lager'"; I got 100100100 for kg_pa_lager But if I do this: $sql = "SELECT kg_pa_lager FROM dynamit WHERE valgt_lager = '$valgt_lager' AND varenr = '$varenr'"; I got NULL. Look at varenr = EDY22X180 in the select where and that it is in the table under varenr. But why is kg_pa_lager NULL? This is strange to me but I guess you know why? Thanks for your advice. Karl I got the solution. I had forget to write "K" at end of the serial number. Now it is OK. Karl