Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
WebProgrammingProject
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
thanutcha siri
WebProgrammingProject
Commits
542b8e2c
Commit
542b8e2c
authored
May 27, 2018
by
thanutcha siri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WebProgramingProject DNATranslation
parents
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
connect.php
connect.php
+52
-0
main.php
main.php
+0
-0
No files found.
connect.php
0 → 100644
View file @
542b8e2c
<!DOCTYPE html>
<html
lang=
"en"
dir=
"ltr"
>
<head>
<meta
charset=
"utf-8"
>
<title></title>
</head>
<style
media=
"screen"
>
</style>
<body>
<?php
$servername
=
"localhost"
;
$username
=
"root"
;
$password
=
""
;
$dbname
=
"webproject"
;
// Create connection
$conn
=
new
mysqli
(
$servername
,
$username
,
$password
,
$dbname
);
mysqli_set_charset
(
$conn
,
"utf8"
);
//เซ็ตค่าให้รองรับภาษาไทย
// Check connection
if
(
$conn
->
connect_error
)
{
die
(
"Connection failed: "
.
$conn
->
connect_error
);
}
else
{
//echo "Connected successfully";
}
$db
=
mysqli_select_db
(
$conn
,
$dbname
);
$id
=
$_GET
[
'abc'
];
//รับค่าabcมาจากหน้า main.php
$sql
=
"SELECT * FROM codon WHERE Cid = '
$id
'"
;
//เลือกข้อมูลมาแสดงตามidที่getมา
$result
=
mysqli_query
(
$conn
,
$sql
);
$row
=
mysqli_fetch_array
(
$result
);
//ใช้ในการคืนค่าข้อมูลในฐานข้อมูลที่อยู่ในลักษณะเป็นแถวหรือว่าเป็น โดยตัวแปรผลลัพท์ที่มันคืนค่ากลับคืนมานั้นจะอยู่รูปแบบของตัวแปรอาร์เรย์
$pic
=
$row
[
"pic"
];
//รูปภาพ
$name
=
$row
[
"name"
];
//ชื่อกรดอมิโน
$detail
=
$row
[
'Detail'
];
//รายละเอียด
?>
<!-- ส่วนแสดงรูปภาพ -->
<center><img
src=
'
<?php
echo
$pic
;
?>
'
style=
"width:300px;height:150px;"
></center>
<!-- แสดงชื่อและรายละเอียด -->
<?php
echo
"<center>"
.
$name
.
"</center><br>"
.
$detail
;
?>
</body>
</html>
main.php
0 → 100644
View file @
542b8e2c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment