Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding within a loop...

Featured Replies

Looking for some help if anyone can do spare some time...

 

I'm stuck with a query, and I have no idea on how to solve this, so I'm showing what I have in the hope that someone can help, and if not, then perhaps point me in the right direction...

 

So I have a database with some results inside it, lets say it's football. Every week I add the new results, for the teams, and I'm echo'ing the results to a webpage. Simple enough so far..

 

I'm stuck with the problem of if Team A plays Team B, then the week later Team A plays Team C. In the first match they score 2 goals... so the record in the database is Team A 2 - Team B 0. Then in the next match they score 3 goals, so the next record is Team A 3 - Team C 1.

 

I can get the results so they print each record on a line, with a loop. The issue I'm having, is I only want Team A = 5 goals <next line> team C = 1 goal <next line> team B = 0 goals..

 

So it lists every team, by the amount of goals they have, by combining all goals across each record related to the team, rather than printing every record.

 

Code that I have so far....

 

		<?php
		while($row = mysql_fetch_assoc($result)) {
	?>
   		<tr bgcolor="#FFFFFF" class="noborder">	
			<td><?php echo ($row['Team_Name']); ?></td>				
			<td><?php echo $row['Team_Goals']; ?></td>
			</tr>
	<?php } ?>

 

Can anyone help?

Looking for some help if anyone can do spare some time...

 

I'm stuck with a query, and I have no idea on how to solve this, so I'm showing what I have in the hope that someone can help, and if not, then perhaps point me in the right direction...

 

So I have a database with some results inside it, lets say it's football. Every week I add the new results, for the teams, and I'm echo'ing the results to a webpage. Simple enough so far..

 

I'm stuck with the problem of if Team A plays Team B, then the week later Team A plays Team C. In the first match they score 2 goals... so the record in the database is Team A 2 - Team B 0. Then in the next match they score 3 goals, so the next record is Team A 3 - Team C 1.

 

I can get the results so they print each record on a line, with a loop. The issue I'm having, is I only want Team A = 5 goals <next line> team C = 1 goal <next line> team B = 0 goals..

 

So it lists every team, by the amount of goals they have, by combining all goals across each record related to the team, rather than printing every record.

 

Code that I have so far....

 

		<?php
		while($row = mysql_fetch_assoc($result)) {
	?>
   		<tr bgcolor="#FFFFFF" class="noborder">	
			<td><?php echo ($row['Team_Name']); ?></td>				
			<td><?php echo $row['Team_Goals']; ?></td>
			</tr>
	<?php } ?>

 

Can anyone help?

 

 

Why don't you write a function from data you have already and filter what's needed?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.