|
 |
|
ช่วยที่ครับผมเดือดร้อน ข้อมุลลงฐานข้อมุล แต่น่า product มันไม่แสดงผลไรเลย |
|
 |
|
|
 |
 |
|
</tr>
</tr>
มี </tr> ตั้งสองตัวครับ เอาออกตัวนึง หรือจะเอาออกหมดก็ได้ครับ 
http://gunner.freetzi.com/
|
 |
 |
 |
 |
Date :
2009-08-16 07:56:19 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?
session_start();
if ($sess_adminid==session_id()) {
header ("Location : admin.php"); exit();
}
include "connect.php";
$sql="select * from tb_product order by id_prd desc";
$result=mysql_db_query($dbname,$sql)or die(mysql_error());
$number=mysql_num_rows($result);
$no=1;
?>
<html>
<head><title>ร้านค้าออนไลน์ สำหรับผู้ดูแลระบบ</title></head>
<body>
<?
include"admin_menu.php";
if ($number<>0){?>
<p><strong>แสดงสินค้า</strong></p>
<table border="1">
<tr bgcolor="#E8E8E8">
<TD><CENTER><B>รหัสสินค้า</B></CENTER></TD>
<TD><CENTER><B>สินค้า</B></CENTER></TD>
<TD><CENTER><B>ประเภทสินค้า</B></CENTER></TD>
<TD><CENTER><B>ราคา</B></CENTER></TD>
<TD><CENTER><B>[แก้ไข]</B></CENTER></TD>
<TD><CENTER><B>[ลบ]</B></CENTER></TD>
</tr>
<?php
while($rs=mysql_fetch_array($result)) {
$id_prd=$rs[id_prd];
$code_prd=sprintf("%05d",$id_prd);
$name_prd=$rs[name_prd];
$ref_id_type=$rs[ref_id_type];
$price_prd=$rs[price_prd];
$photo_prd=$rs[photo_prd];
$sql2="select name_type from tb_type where id_type='$ref_id_type'";
$result2=mysql_db_query($dbname,$sql2) or die(mysql_error());
$rs2=mysql_fetch_array($result2);
$name_type=$rs2[name_type];
?>
<tr>
<td><?=$id_prd?></td>
<td><?=$name_prd?></td>
<td><?=$name_type?></td>
<td><?=$price_prd?></td>
<td><?='<a href=\"admin_product_edit.php?id_edit=$id_prd\">';?>[แก้ไข]</a></td>
<td><?='<a href=\"admin_product_delete.php?id_del=$id_prd&photo_del=$photo_prd\"
onclick=\"return confirm(\'ยืนยันลบประเภทสินค้า $name_prd ออกจากระบบ\')\">';?>[ลบ] </a></td>
</tr>
<?php
$no++;
}
?>
</table>
<?php
mysql_close();
}
?>
</body>
</html>
ผมชอบเขียนโค้ด style แบบเห็น design นะครับ เวลาเราจะเคลื่อนย้าย หรือเพิ่ม column เพิ่ม row มันสะดวกนะครับ
|
 |
 |
 |
 |
Date :
2009-08-16 09:07:54 |
By :
DownsStream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าเป็นแบบเห็น ตาราง design น่าจะดีนะครับ
|
 |
 |
 |
 |
Date :
2009-08-17 03:09:24 |
By :
tarorio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันอยู่ที่ คนชอบ นะครับ บางคนชอบดูโค้ด มากกว่า ดีไซน์ แล้วแต่ถนัดครับ
|
 |
 |
 |
 |
Date :
2009-08-17 09:13:54 |
By :
DownsStream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ชอบทั้งสองครับ เปิดไว้อย่างละครึ่งจอ
|
 |
 |
 |
 |
Date :
2009-08-17 09:42:34 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|