Hrvoje Posted November 24, 2010 Share Posted November 24, 2010 Pls tell me what is wrong? <?PHP include("dba.php"); function hvataj ($trazi, $id) { $upit = mysql_query ('select * from administrator where member_id = '.$id.''); return ( $row = mysql_fetch_assoc ($upit) ) ? $row[$trazi] : mysql_error (); } ?> I have parse error here on this line when I want to echo it: <?PHP echo "<img src='images/korisnik_slike/".hvataj('slika',$_SESSION['member_id']."' />"; ?> Link to comment https://forums.phpfreaks.com/topic/219727-php-session/ Share on other sites More sharing options...
jdavidbakr Posted November 24, 2010 Share Posted November 24, 2010 You're missing a closing ")" in your call to hvataj() Link to comment https://forums.phpfreaks.com/topic/219727-php-session/#findComment-1139105 Share on other sites More sharing options...
Hrvoje Posted November 24, 2010 Author Share Posted November 24, 2010 aaarrg ))) Thanks Link to comment https://forums.phpfreaks.com/topic/219727-php-session/#findComment-1139117 Share on other sites More sharing options...
Hrvoje Posted November 24, 2010 Author Share Posted November 24, 2010 Many thanks for this ) close. But I have another question. Now I have that simple script, when admin loged in than echo avatar of that admin. Nothing happens?? <?php include("dba.php"); function hvataj ($trazi, $id){ if(!$_SESSION['member_id']){ $upit = mysql_query ('select * from administrator where member_id = '.$id.''); return ( $row = mysql_fetch_assoc ($upit) ) ? $row[$trazi] : mysql_error (); } ?> <?php echo "<img src='images/slika_korisnik/".hvataj('slika',$_SESSION['member_id'])."' width='82' height='82' />"; ?> <?PHP } ?> Link to comment https://forums.phpfreaks.com/topic/219727-php-session/#findComment-1139170 Share on other sites More sharing options...
jdavidbakr Posted November 24, 2010 Share Posted November 24, 2010 Are you sure you're getting a row in your query? Try echoing the query right after you compose it and double-check it by copying it into phpMyAdmin. Link to comment https://forums.phpfreaks.com/topic/219727-php-session/#findComment-1139173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.