Create Table PHP with connection MySQL DB

  • 0 Replies
  • 1023 Views
*

PF2G

  • Newbie
  • *
  • 4
  • +0/-0
    • View Profile
Create Table PHP with connection MySQL DB
« on: October 25, 2011, 06:01:56 PM »
Hello, PHPFreaks

I'm creating a website about a Music School and i want to create a table with the instruments one row with image and a row bellow with their name.

Code:

Code: [Select]
<table width="200" height="134">
<?PHP

//connect database
$dbhost = "";
$db = "";
$dbuser = "";
$dbpass = "";
$connect = mysql_connect($dbhost,$dbuser,$dbpass) or die ("Falha ao ligar à Base de Bados: " . mysql_error());

//3 columns limit
i == 3;
while {
 i == i + 1;
 if i == 1 {
?>
<tr>
<td>

<?PHP 
}  else 
{
?>
<td>

<?   
}
$sql = "SELECT nome_curso, imagem_curso FROM cursos ORDER BY nome_curso";
}
if i == 3 {
?>
</td>
</tr>

<?
}else
{
?>
</td>

<?PHP
}?>
</table>


The name and the image are in a MySQL DB.

Please help me.

 




See Our Webmaster Tools for Windows and Mac

A1 Sitemap Generator
      
A1 Website Analyzer
      
A1 Keyword Research
      
A1 Website Download
      
A1 Website Search Engine
      
A1 Website Scraper