[Malvern] Having a php nightmare

Cheryl Phillips owensmum at Safe-mail.net
Tue Aug 8 13:54:49 BST 2006


Can anyone out there help before I throw something? 

we've got something along these lines

$sql = "SELECT branch_name FROM LOCATION";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
			
				
				foreach ($row as $branch)
				{
					echo $branch;
					
				}


-- I did have that in a while loop but things went a bit crazy! There is also a bit of html echo'ed in there too as this is part of a form but for claritys sake... anyway! 

At present there are only 2 values in the  database but it is repeating the first value twice instead of giving me value 1 followed by value 2. At once point it was giving me both of them in duplicate but that was before I eradicated the while loop. I cant ever remember having this issue before but it has probably been 2 years since I used foreach and I seem to be completely lacking in brainpower lately!

Cheers in advance guys!

Cheryl


www.owenkyle.blogspot.com



More information about the Malvern mailing list