LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-30-2004, 07:15 PM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
PHP Array Trouble


Hi All. I'm trying to show all the records inside the array. But Doesn't shows me the first one, and show twice the last one. What could be the problem? Some wrong tag of HTML?

Would be great if someone could help me out..

Thanks a lot.


PHP Code:
$name="";    
echo 
"\t</tr><tr>\n";
include_once(
"Puntos.php");

while (
$line mysql_fetch_assoc($result))
    {
    if(
$line['equipo']!=$name && $name != "")   
        {
        echo 
"\t<td  align=\"center\"><FONT SIZE=1 COLOR=BLACK>"; echo Punteo($line['equipo']); echo"</FONT> </td></tr><tr>\n";      
        }
    if(
$line['equipo']!=$name)    
        {
        echo 
"\t<td ><FONT SIZE=1 COLOR=BLACK>".$line['equipo']."</FONT></td>\n";       
        }        
       echo 
"\t\t<td align=\"center\"><FONT SIZE=1 COLOR=BLUE>".$line['homescore'].' - '.$line['awayscore']."</FONT></td>\n";
      
       
$name=$line['equipo'];      
    }    
        echo 
"\t<td  align=\"center\"><FONT SIZE=1 COLOR=BLACK>"; echo Punteo($name); echo "</FONT></td>\n"

Last edited by Gerardoj; 05-30-2004 at 07:39 PM.
 
Old 05-30-2004, 09:27 PM   #2
flakzeus
Member
 
Registered: Jan 2004
Location: Salisbury, NC
Distribution: Gentoo 2004.1
Posts: 48

Rep: Reputation: 15
It would help to see more of the code, I'm guessing there is a <tr> above this code?
 
Old 05-30-2004, 09:53 PM   #3
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
Thanks fro your reply.. This is the whole code... what part could be the problem?..

PHP Code:
echo "\t<tr><FONT SIZE=2 COLOR=#206b3a><strong>Division - ></strong></FONT><FONT SIZE=2 COLOR=#206b3a><strong> $Division</strong></FONT></tr>\n";

echo 
"<table width=\"850\" align=\"center\" border=\"1\" BGCOLOR=\"#CCCCCC\"><tr>\n";

$nombre="";

echo 
"\t<td><FONT SIZE=1 COLOR=BLACK>Team</FONT></td>\n";
while (
$linea mysql_fetch_assoc($resultado))
    {    
    if(
$linea['hometeam']!=$nombre && $nombre != "")    
        {        
    
        }        
    if(
$linea['hometeam']!=$nombre)      
        {  
        }
           
       echo 
"\t\t<td align=\"center\" BGCOLOR=\"#206b3a\"><FONT face=TAHOMA SIZE=1 COLOR=white>".$linea['hometeam'].' - '.$linea['awayteam'].'  '.$linea['homescore'].' - '.$linea['awayscore']."</FONT></td>\n";      
       
$nombre=$linea['hometeam'];

    }
  echo 
"\t<td><FONT SIZE=1 COLOR=BLACK>Puntos</FONT></td>\n";  
  
$name="";
    
echo 
"\t</tr><tr>\n";

include_once(
"Puntos.php");

while (
$line mysql_fetch_assoc($result))
    {
    if(
$line['equipo']!=$name && $name != "")   
        {
        echo 
"\t<td  align=\"center\"><FONT SIZE=1 COLOR=BLACK>"; echo Punteo($line['equipo']); echo"</FONT> </td></tr><tr>\n";      
        }
    if(
$line['equipo']!=$name)    
        {
        echo 
"\t<td ><FONT SIZE=1 COLOR=BLACK>".$line['equipo']."</FONT></td>\n";
       
        }
        
       echo 
"\t\t<td align=\"center\"><FONT SIZE=1 COLOR=BLUE>".$line['homescore'].' - '.$line['awayscore']."</FONT></td>\n";
       
//echo "\t\t<td>".$line['awayscore']."</td>\n";     
       
$name=$line['equipo'];
      
    }
    
        echo 
"\t<td  align=\"center\"><FONT SIZE=1 COLOR=BLACK>"; echo Punteo($name); echo "</FONT></td>\n"

  
echo 
"</tr></table>\n"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++: Trouble declaring dynamic array Hady Programming 7 11-01-2005 01:06 AM
PHP Trouble to get Array Gerardoj Programming 5 03-28-2005 07:14 AM
php: array with functions ldp Programming 7 09-22-2004 04:55 PM
PHP array help? HappyDude Programming 1 10-13-2003 06:48 PM
php array gui10 Programming 2 03-26-2002 02:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration