Jump to content

got a quick question


sandrob57

Recommended Posts

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


$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 :P

 

But, would my scenario work?

Link to comment
https://forums.phpfreaks.com/topic/40307-got-a-quick-question/#findComment-194998
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.