Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > PHP > PHP Forum > ดู code ให้ผมทีน่ะครับ ตรงช่องที่แสดงประเภทสินค้า ผมอยากให้มันแสดงเป็นชื่อประเภทสินค้าเลยครับไม่ใช่ id



 

ดู code ให้ผมทีน่ะครับ ตรงช่องที่แสดงประเภทสินค้า ผมอยากให้มันแสดงเป็นชื่อประเภทสินค้าเลยครับไม่ใช่ id

 



Topic : 039831

Guest




ภาพ

ตรงช่องที่แสดงประเภทสินค้า ผมอยากให้มันแสดงเป็นชื่อประเภทสินค้าเลยครับไม่ใช่ id เขียน code แบบไหนครับ

แล้วก็ตรงที่ช่องจำนวน ผมอยากได้แบบใส่ตัวเลขไปแล้วให้แสดงผลลัพธ์เลยอะครับ ขอความกรุณาด้วยน่ะครับ

ไม่รู้ว่า code ผิดตรงไหนครับ ชื่อประเภทสินค้าของผมใช้ t_name อะครับ

<?
session_start();
include "function_chklogin.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ตระกร้าสินค้า</title>
<link href="normal_font.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style1 {
font-size: 14px;
font-weight: bold;
color: #FF0000;
}
.style2 {color: #000000}
.style4 {font-size: 15px}
.style6 {font-size: 13px}
-->
</style></head>

<body>
<? include "head_user.php" ?>
<br />
<table width="920" align="center">
<tr>
<td width="160" align="left" valign="top" scope="row"><? include "login.php"?>
<? include "menu_type.php"?>
<? include "menu.php"?></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><span class="style6">
<?

$sess_id=$_SESSION['sess_id'];
$sess_name=$_SESSION['sess_name'];
$sess_price=$_SESSION['sess_price'];
$sess_type=$_SESSION['sess_type'];

$sql2= "select * from tb_type where t_id='$sess_type'";
$sqlquery2=mysql_db_query($dbname,$sql2);
$result2= mysql_fetch_array($sqlquery2);
$typename=$result2['t_name'];

$sess_num=$_SESSION['sess_num'];

?>
<strong>

<?

if(count($sess_id)==0){

?>
</strong><font color="#FF0000">ยังไม่มีสินค้าในตะกร้าสินค้าของท่านครับ <a href="productall.php" title="เลือกซื้อสินค้า">คลิกที่น</a><strong><strong><a href="productall.php" title="เลือกซื้อสินค้า">ี่</a> </strong></strong>เพื่อเลือกซื้อสินค้าน่ะครับ<strong><strong>
<?

}else{

?>
</strong></strong></font></span>
<table width="715" cellpadding="0" cellspacing="1" bordercolor="#FF9FAA">
<tr align="center" bgcolor="#FF9FAA" class="normal_font">
<td width="5%" height="22"><strong>ลบ</strong></td>
<td width="15%"><strong>รหัสสินค้า</strong></td>
<td width="12%"><strong>ประเภทสินค้า</strong></td>
<td width="23%"><strong>สินค้า</strong></td>
<td width="12%"><strong>จำนวน</strong></td>
<td width="18%"><strong>ราคา</strong></td>
<td width="15%" colspan="2"><strong>รวม</strong></td>
</tr>
<?php

for($i=0;$i<count($sess_id);$i++){
$total_unit=$sess_num[$i]*$sess_price[$i];
$total=$total+$total_unit;
$code=sprintf("%05d",$sess_id[$i]);
?>
<tr align="center" bgcolor="#D2EEFF">
<td><input name="id_del[]2" type="checkbox" id="id_del[]2" value="<?=$sess_id[$i]?>" /></td>
<td bgcolor="#D2EEFF" class="style4">
<?=$code?> </td>
<td height="22" class="style4">
<?=$typename[$i]?> </td>
<td class="style4">
<?=$sess_name[$i]?> </td>
<td><input name="prd_num[]2" type="text" id="prd_num[]2" style="text-align:center" value="<?=$sess_num[$i];?>" size="5" maxlength="3" /></td>
<td class="style4"><? echo number_format($sess_price[$i],2);?></td>
<td class="style4"><? echo number_format($total_unit,2);?></td>
</tr>
<?

}

?>
<tr>
<td height="22" colspan="8" align="right" class="normal_font">&nbsp;</td>
</tr>
<tr bgcolor="#D4DFAA">
<td height="22" colspan="8" align="right" bgcolor="#FFFFFF" class="style1"><span class="style2">จำนวนราคาทั้งหมด </span> <? echo number_format($total,2);?> <span class="style2">บาท</span></td>
</tr>
<tr>
<td height="22" colspan="8" align="right">&nbsp;</td>
</tr>
<tr>
<td height="22" colspan="8" align="right"><input name="continuebuy" type="button" id="continuebuy" onclick="window.location='productall.php' " value="ซื้อสินค้าต่อ" />
<input name="complete" type="button" id="complete" value="ยืนยันสั่งซื้อสินค้า" onclick="window.location='form_order.php' " /> </td>
</tr>
</table>
<br />
<?
}
?></td>
</tr>
</table>
<br />

<table width="940" align="center">
<tr>
<td width="150" align="left" valign="top" scope="row">&nbsp;</td>
<td align="center" valign="top">
<p><br />
<br />

<tr>

<td align="left">

<form action="" method="post" name="calculate" id="calculate"><tr>

<td height="25" align="center"><br />

<br /></td>

</tr>
</form>
</body>
</html>



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-03-03 13:58:16 By : chonburi f.c View : 1124 Reply : 4
 

 

No. 1



โพสกระทู้ ( 333 )
บทความ ( 0 )



สถานะออฟไลน์


อ่อ คืองี้ ไห้ทำการ select 2 ตาราง อะครัฟ

เเล้ว ก้อเอามา โชว์เลย






Date : 2010-03-05 12:18:42 By : deathzap
 


 

No. 2

Guest


ยังไงอะครับ ไม่เข้าใจ concept อธิบายด้วย code ได้ไหมครับ
Date : 2010-03-05 17:49:08 By : chonburi f.c
 

 

No. 3



โพสกระทู้ ( 768 )
บทความ ( 0 )



สถานะออฟไลน์


ถ้าผมเดานะคุณเก็บสินค้า กับประเภทสินค้า อยู่คนละตารางใช่ปะ ถ้าใช่ก็ต้อง join กันด้วยรหัสประเภทสินค้า แล้วselect เอา t_name มาครับไม่ใช่ t_id ลองดู ถ้ายังไม่ได้ขอดูตารางทั้งสองด้วยครับ
Date : 2010-03-05 20:21:09 By : naskw
 


 

No. 4

Guest


ตารางสินค้าครับ

tb_product


ตารางประเภทสินค้าครับผม

tb_type

ช่วยทีครับ
Date : 2010-03-06 11:59:17 By : chonburi f.c
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ดู code ให้ผมทีน่ะครับ ตรงช่องที่แสดงประเภทสินค้า ผมอยากให้มันแสดงเป็นชื่อประเภทสินค้าเลยครับไม่ใช่ id
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่