Back in my day.... we used mysql_query. now its some mysqli shit.
as far as I can tell, i can only use a single DB connection for a single query unless i free the query result from memory. if a free the result inside a foreach, the whole thing dies. the way how i USED to be able to do this would be as follows
$db = 'localhost';
$usr = 'Kyle';
$pwd = 'kim';
if(!$resrouce = mysql_connect($db, $usr, $pwd, 'forum') die "error: ".mysql_error();
if(!$q1 = mysql_query($resrouce, "select `admin` from `new` where admin == ''")) die "Error: ".mysql_error();
$r1=mysql_result($q1);
foreach($r1 as $v)
{
if($v['admin'] == null)
{
if(!$q2 = mysql_query($resrouce, "select `user` from `other` where admin == 'True'")) die "Error: ".mysql_error();
$r2=mysql_result($q2);
}
}
where i run into an error in during the $q2 query.
as far as I can tell, i can only use a single DB connection for a single query unless i free the query result from memory. if a free the result inside a foreach, the whole thing dies. the way how i USED to be able to do this would be as follows
$db = 'localhost';
$usr = 'Kyle';
$pwd = 'kim';
if(!$resrouce = mysql_connect($db, $usr, $pwd, 'forum') die "error: ".mysql_error();
if(!$q1 = mysql_query($resrouce, "select `admin` from `new` where admin == ''")) die "Error: ".mysql_error();
$r1=mysql_result($q1);
foreach($r1 as $v)
{
if($v['admin'] == null)
{
if(!$q2 = mysql_query($resrouce, "select `user` from `other` where admin == 'True'")) die "Error: ".mysql_error();
$r2=mysql_result($q2);
}
}
where i run into an error in during the $q2 query.
Last edited: