sandrob57 Posted February 27, 2007 Share Posted February 27, 2007 I have an array. lets say I put the results in $data Could I include a PHP file in the array, and have that file use the $data variable? Or is the $data variable strictly for the page? Link to comment https://forums.phpfreaks.com/topic/40307-got-a-quick-question/ Share on other sites More sharing options...
AV1611 Posted February 27, 2007 Share Posted February 27, 2007 Um... Huh? I don't understand what you are asking... Link to comment https://forums.phpfreaks.com/topic/40307-got-a-quick-question/#findComment-194983 Share on other sites More sharing options...
sandrob57 Posted February 27, 2007 Author Share Posted February 27, 2007 i have this: $result = dbquery("SELECT * FROM fusion_war WHERE a_id='".$userdata['user_id']."' OR d_id='".$userdata['user_id']."'"); while ($data = dbarray($result1)) { if ($data['a_id'] == $userdata['user_id']){ //offensive $a_id = $userdata['user_id']; $d_id = $data['d_id']; $start = $data['war_start']; $update = $userdata['a_update']; }elseif ($data['d_id'] == $userdata['user_id']){ //defensive $a_id = $data['a_id']; $d_id = $userdata['user_id']; $start = $data['war_start']; $update = $userdata['d_update']; } include "".BASEDIR."wars/formula_moves.php"; } //end array Would i be able to user $data['field'] on the include? Link to comment https://forums.phpfreaks.com/topic/40307-got-a-quick-question/#findComment-194984 Share on other sites More sharing options...
Archadian Posted February 27, 2007 Share Posted February 27, 2007 $result = dbquery("SELECT * FROM fusion_war WHERE a_id='".$userdata['user_id']."' OR d_id='".$userdata['user_id']."'"); while ($data = dbarray($result1)) { in your while() statement shouldn't $result1 be $result? Link to comment https://forums.phpfreaks.com/topic/40307-got-a-quick-question/#findComment-194993 Share on other sites More sharing options...
sandrob57 Posted February 27, 2007 Author Share Posted February 27, 2007 $result = dbquery("SELECT * FROM fusion_war WHERE a_id='".$userdata['user_id']."' OR d_id='".$userdata['user_id']."'"); while ($data = dbarray($result1)) { in your while() statement shouldn't $result1 be $result? Yeah i was just posting sample code But, would my scenario work? Link to comment https://forums.phpfreaks.com/topic/40307-got-a-quick-question/#findComment-194998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.