<?php $db = mysql_connect('localhost', 'root', '111'); mysql_select_db('cat',$db); $rez = mysql_query('SELECT * FROM cat'); while($r = mysql_fetch_assoc($rez)) echo $r['$name']; ?>