Hello I have this problem i hope someone can help me to solve. in my database i have a row called "Private" in the table "images" where 0 is not private and 1 is private. if private is set to 1 the image uploaded is hidden on the site, if it's 0 anyone can se it on the site. in my code for the page to view images at the top im doing this query $db->setQuery("select i.id,i.views,i.name,i.size,i.width,i.height,s.domain,u.gid,i.server_id,i.private from images as i left join users as u on u.id=i.uid left join server as s on s.server_id=i.server_id where i.id='$id'"); PHP: After this im doing this $safe = "private"; $template->assign_var('private',$row[$safe]); if ( private == 1 ) { echo "This"; } else { echo "That"; } PHP: now the problem. When i upload the file with this code, is shows "This" even if private is set to 0. why is this ?
Unless it's does define, private evals to (int) 1. Turn error_reporting(E_ALL); to understand more. if ( $private == 1 ) { Maybe? (Assuming assign_var does something along the lines of ${$var} = $value
when i now checked the output it dosent show any value for assign_var :/ so i need to ask. by the db query above, do you know if there is another way to check if private is 1 or 0 and then do the if/else?