I know that this php code is bad
<?php
$id=$_SESSION['id'];
?>
but it saves from writing that long code !
For better readability we have to loss some memory,
Q-> but is it really bad [if I have 5 such variables in a page] ?
================================================================
Q-> which one works faster ?
1-> mysqli_prepare("sql");
2-> mysql_real_escape_string("input");
mysqli_query("sql");
================================================================
Q-> is it efficient to close mysqli after it’s job is finished in every page ?
Q-> but is it really bad [if i have such 5 variable in page] ?
you should sanitize your input variables!
Q-> which one works fast ?
mysqli_prepare() ist faster in most cases
Q-> is it efficient to close mysqli after it’s job is finish in every page ?
i think it is a good cosing style and should be done!