Jump to content

MYSQL Query not working it's the WHILE.


jamesxg1

Recommended Posts

Hiya peeps!

 

I have this code;

 

	$q3 = "SELECT `data` FROM `firm_text_strings` WHERE `id` = '100' AND `languages_id` = 'EN'";
	$q4 = "SELECT `data_2` FROM `firm_text_strings` WHERE `id` = '100' AND `languages_id` = 'EN'";

	$r3 = mysql_query($q3);
	$r4 = mysql_query($q4);
	if($r3 && $r4) {
		while($w3 = mysql_fetch_assoc($r3) && $w4 = mysql_fetch_assoc($r4)) {
			$resultStr = $w3['data'] . '<br />' . $w4['data_2'];
		}
	} else {
		$resultStr = 'error';
	}

 

everything is working up to the while function, it just wont do the loop for some reason. Anyone have any ideas.

 

Many thanks,

 

James.

Link to comment
https://forums.phpfreaks.com/topic/221166-mysql-query-not-working-its-the-while/
Share on other sites

	$q1 = "SELECT `data`, `data_2` FROM `firm_text_strings` WHERE `id` = '100' AND `languages_id` = 'EN'";

	$r1 = mysql_query($q1);
	if($r1) {
		while($w1 = mysql_fetch_assoc($r1)) {
			$resultStr = $w1['data'] . '<br />' . $w1['data_2'];
		}
	} else {
		$resultStr = 'error';
	}

 

Changed, still nothing =/

 

Many thanks,

 

James.

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.