01.
<div id=
"content"
>
02.
<?
03.
$link
= mysql_connect (
"localhost"
,
"ownmylif_db"
,
"1234"
);
04.
if
(!
$link
)
05.
{
06.
print (
"Error"
);
07.
exit
();
08.
}
09.
mysql_select_db(
"ownmylif_db"
,
$link
);
10.
?>
11.
<table width=
"100%"
border=
"1"
cellpadding=
"4"
>
12.
<tr valign=
"top"
>
13.
<td width=
"30%"
>
14.
<?
15.
$sql
=
"select id, thainame from nutritionalmedicine"
;
16.
$res
=mysql_query (
$sql
,
$link
);
17.
while
(
$row
=mysql_fetch_row(
$res
))
18.
{
19.
print (
"<a href=nutritionalmedicine.php?ID=$row[0]> $row[0] $row[1] </a><br />"
);
20.
}
21.
?>
22.
</td>
23.
24.
<td width=
"70%"
>
25.
<?
26.
print (
"$ID"
);
27.
if
(
$ID
<> null)
28.
{
29.
$sql
=
"select * from nutritionalmedicine where id=$ID"
;
30.
$res
=mysql_query(
$sql
,
$link
);
31.
if
(mysql_num_rows(
$res
)!=0)
32.
{
33.
$row
=mysql_fetch_row(
$res
);
34.
print (
"id:$row[0]<br />"
);
35.
print (
"thai name:$row[1]<br />"
);
36.
print (
"eng name:$row[2]<br />"
);
37.
print (
"other name:$row[3]<br />"
);
38.
print (
"pic1:$row[4]<br />"
);
39.
print (
"pic2:$row[5]<br />"
);
40.
print (
"pic3:$row[6]<br />"
);
41.
print (
"about:$row[7]<br />"
);
42.
print (
"diet:$row[8]<br />"
);
43.
print (
"homeremedies:$row[9]<br />"
);
44.
print (
"dailysupplements:$row[10]<br />"
);
45.
print (
"herbaltherapy:$row[11]<br />"
);
46.
print (
"exercise:$row[12]<br />"
);
47.
print (
"acupressure:$row[13]<br />"
);
48.
print (
"avoid:$row[14]<br />"
);
49.
}
50.
else
51.
print(
"No Data"
);
52.
}
53.
?>
54.
</td>
55.
</tr>
56.
</table>
57.
<?
58.
mysql_close(
$link
);
59.
?>
60.
</div><!--
end
#content -->