Jak mogę za pomocą skryptu wyciągnąć user_id (id) bo już tu jest zrobione by wyciągnęło username i access ale jak próbuje dorobić user_id to się nieda;/
<?php
<? require_once('config.php'); // załaczamy plik config.php function usun($data){ } } $message .= '<font class="blad">Nie podałeś loginu</font><br />'; $l = FALSE; }else{ $l = usun($_POST['login']); } $message .= '<font class="blad">Nie podałeś hasła</font><br />'; $h = FALSE; }else{ $h = usun($_POST['haslo']); } if ( $l && $h ){ $query = "SELECT username, access FROM user WHERE username='$l' AND haslo=md5('$h')"; if($row){ $_SESSION['username'] = $row['username']; $_SESSION['access'] = $row['access']; $_GET['cmd'] = 'ok'; }else{ $message .= '<font class="blad">Błędne hasło lub login</font><br />'; } }else{ $message .= '<font class="blad">Spróbuj jeszcze raz</font>'; } } ?> <? if(!$_SESSION['username'] || $_SESSION['access']=="") { ?> <table align="center" border="0"> <tr> <td align="right" class="uni_01">Login:</td> <td><input type="text" name="login" size="15"></td> </tr> <tr> <td align="right" class="uni_01">hasło:</td> <td><input type="text" name="haslo" size="15"></td> </tr> <tr> <td align="right" class="uni_01"> </td> <td> <p align="center"><input style="font-weight: bold;" type="submit" name="submit" value="loguj"> </td></tr> </table> </form> <? } else { ?><? } ?>
session_start();
$username = $_SESSION['username'];
?>
<?php
session_start();
if(!session_is_registered("username")){ // Sprawdza zmienną sesji.
header("location:index.php"); // Przekierowanie do index.php
}
?>[/PHP]
Pomoże ktoś

Bo potrzebuje id czyli user_id do tego:
$ilew=mysql_num_rows(mysql_query("select wiad_id from wiadomosci where wiad_przeczytane=0 and wiad_do=".$_SESSION["user_id"]." and wiad_czyj=0"));
a jak narazie niemam z czego pobrac
