invalid arguments error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zuzupus
Forum Commoner
Posts: 70
Joined: Thu Jul 17, 2003 4:54 am

invalid arguments error

Post by zuzupus »

hi,
iam getting error when using foreach()

**Invalid argument supplied for foreach() **
is it right way to use JOIN and let say value of fk_t_directories=312 so i tried to use <?=$r->sys_pk ?>
as this value im getting from

Code: Select all

query_db("SELECT info FROM t_directories");
                         while($r = foreach_db()) 
                          {
		$info[$r->sys_pk] = $r;
	      }

query_db("SELECT u.name,u.sys_pk FROM t_user u INNER JOIN tr_directories_user r ON r.fk_t_user=u.sys_pk WHERE r.fk_t_directories='<?=$r->sys_pk ?>'");
	while($q = foreach_db()) 
                    {
	             $names[$q->sys_pk] = $q;
	}
and with this querry i want to get value in my field

Code: Select all

<td>CLients</td>
<? foreach($names as $q) { ?>//getting error in this line
  <tr>
   <td class="black2">
   <input type="radio" name="user" value="<?=$r->sys_pk ?>" id="<?="dir{$r->sys_pk}" ?>" /> <label for="<?="dir{$r->sys_pk}" ?>"><?=htmlentities($q->name) ?></label>
  </td>
  </tr>
    <? } ?>
Clients apple//these values coming from JOIn querry
ibm
MS

anybod figure out the solution be really appreciable

thanks
Post Reply