How to delete all variable and store array and some php variable and loop while ?
This is my code for delete all variable and store array objResult
and $c
variable and loop while until complete.
But when i test code. it's will be store only $c
, How to store array objResult
too.
And my code not loop while too. how can i do for store $c
and array objResult
and loop while
until complete.
<?PHP
include("connect.php");
$strSQL = "SELECT * FROM table WHERE name = ''";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery))
{
$a = "111";
$b = "122211";
$c = "333";
$d = "444";
$defined_variables = get_defined_vars();
$variables2keep = array("objResult" , "c"); // not clear $d and array objResult//
foreach($defined_variables as $variable => $value)
if(!in_array($variable, $variables2keep)) unset($$variable);
echo $objResult["id"];
}
?>