[PHP] Re: diferent data on diferent columns...

2001-11-19 Thread Romeo Manzur

I found the way...
$i = 0;
$result = mysql_query("SELECT * FROM sometable");
echo "   \n";
while($row = mysql_fetch_array($result)){
echo "".$row[id]."\n";
 if($i % 2 == 1){
  echo "  \n";
  echo "  \n";
 }
$i++;
}
echo "  \n";

I hope that this can help to somebody...

Romeo Manzur wrote:

> Hi, I wonder how could I do a script for print direfent data on
> diferents columns from a table...
> I mean this
> $result = mysql_query("SELECT * FROM xxx");
> while(($row = mysql_fetch_array($result)){
> echo "
> echo "
> echo "".$row[id]."\n";//id for the firt record ex:1
> echo "".$row[id]."\n";//id for the second record ex: 2
> echo "\n";
> echo "\n";
>
> if I do this it prints the same record value...
>
> please I need help...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: diferent data on diferent columns...

2001-11-19 Thread Chris Lee

echo "".$row[id]."\n";//id for the firt record ex:1
echo "".$row[name]."\n";//id for the second record ex: 2

or

echo "".$row[0]."\n";//id for the firt record ex:1
echo "".$row[1]."\n";//id for the second record ex: 2

is that what you mean?

--

  Chris Lee
  [EMAIL PROTECTED]



"Romeo Manzur" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi, I wonder how could I do a script for print direfent data on
> diferents columns from a table...
> I mean this
> $result = mysql_query("SELECT * FROM xxx");
> while(($row = mysql_fetch_array($result)){
> echo "
> echo "
> echo "".$row[id]."\n";//id for the firt record ex:1
> echo "".$row[id]."\n";//id for the second record ex: 2
> echo "\n";
> echo "\n";
>
> if I do this it prints the same record value...
>
> please I need help...
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]