Dynadot โ€” .com Registration $8.99

Last PHP Question - I promise

Spaceship Spaceship
Watch

noswad

Established Member
Impact
1
Hi.

I have one last final problem with PHP sessions.

Please take a look at the attached small screen shot. Each session is called [game1] all the way down to game20]

If the database is full for all sessions except [game8] users will see a blank line where [game8] should be.

Is there anyway to move [game9] up one line to prevent the blank space?

Also, as a rule of thumb, I would need such a script to ignore any blank sessions and move all the full lines towards the top.

Thanks VERY much for reading. I promise this is my last question :D

David.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
You Should probalbly use this instead:
Code:
$detect = mysql_query("select `field` from `table` LIMIT 0, 20");
while ($row = mysql_fetch_array($detect, MYSQL_BOTH)) {
   printf("%s", $row[0]); 
}

or at least this is what I think you're trying to do.
 
0
•••
Hi

You have confused me there lol.

Im just looking for a simple script that will ignore blank fields and move the next field containing data upwards to prevent users seeing blank lines on pages.

Thanks for trying though.
 
0
•••
PHP:
for ($i = 1; $i <= 20; $i++) {
  if ($_SESSION['game'.$i]) {
    echo $_SESSION['game'.$i];
}

Displays the game if it is not blank.
 
0
•••
Hi Dan

The page is displaying...

"Parse error: parse error, unexpected $ in /homepages/33/d149588437/htdocs/test.php on line 16"

Thanks for trying :kickass:
 
0
•••
with one more } at the end of the code from Dan it should work.
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back