Jump to content

PHP Echo


ItsWesYo

Recommended Posts

This should work.

[code]<?php

mysql_connect( "localhost", "usernameHIDDEN", "passwordHIDDEN" );
mysql_select_db( "tableHIDDEN" );

$query = mysql_query( "SELECT * FROM items ORDER BY name" );

echo "<table>";

while( $row = mysql_fetch_array( $query ) )
{
      $x++;

      if( $x == 1 ) echo "<tr>";

      echo "<td>" . $row['name'] . "</td>";

      if( $x == 3 )
      {
            echo "</tr>";
            $x = 0;
      }
}

echo "<table>";

?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/13700-php-echo/#findComment-53229
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.