php db_coonect mysql_connect localhost root mysql_select_db ilt db_coo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$db_coonect = mysql_connect('localhost', 'root', '');
mysql_select_db('ilt', $db_coonect);
mysql_query("SET NAMES 'utf8'");
$res = mysql_query("SELECT * FROM `item_lessons_table`", $db_coonect);
$myrow = mysql_fetch_assoc($res);
$row_num = mysql_num_rows($res);
$less_id = $myrow['id'];
$less_item = $myrow['item'];
$less_cub = $myrow['cab'];
$c = 0;
while($row_num < 6){
$less_id[$c] = $myrow['id'];
$less_item[$c] = $myrow['item'];
$less_cub[$c] = $myrow['cab'];
$c++;
}
?>