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,028

HOME > PHP > PHP Forum > เปลี่ยนชื่่อ table แล้วขึ้น Warning: session_start() [function.session-start]:



 

เปลี่ยนชื่่อ table แล้วขึ้น Warning: session_start() [function.session-start]:

 



Topic : 066316



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



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




พอดี เปลี่ยนชื่อตารางครับ แล้วมันก็ขึ้นอย่างนี้เลยครับ ก่อนเปลี่ยนไม่มีปัญหาเลยครับ

Code
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\09521591\index.php:1) in C:\AppServ\www\09521591\index.php on line 4

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\09521591\index.php:1) in C:\AppServ\www\09521591\index.php on line 4


ส่วนcode ก็ตามนี้ครับ

Code (PHP)
<?
ob_start();
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล 
session_start();
require("connect/connect.php");
require("connect/function.php");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>::: RealOne :::</title>
<link href="css/styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {
	font-size: 14px;
	font-style: italic;
	color: #CC0000;
}
-->
</style>
</head>
<body topmargin="0">
<table width="950" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C5E2AF">
  <tr> 
    <td> <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td> 
            <?php require_once('head.php'); ?></td>
        </tr></table></td>
  </tr>
</table>
</td>
		</tr>
        <tr> 
          <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#f2f2f6" bgcolor="#C5E2AF">
              <tr> 
                <td width="30%" valign="top"> 
                  <?php require_once('menuleft.php'); ?>
                </td>
                <td width="40%" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <!--DWLayoutTable-->
                    <tr> 
                      <td width="546" height="24" valign="top"><div align="center">
                        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width', '450','height','316','align','middle','src','flash/bann','quality' ,'high','pluginspage','http://www.macromedia.com/go/getflashplayer' ,'movie','flash/bann' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="450" height="316" align="middle">
                          <param name="movie" value="flash/bann.swf">
                          <param name="quality" value="high">
                          <embed src="flash/bann.swf" width="450" height="316" align="middle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
                        </object>
                      </noscript></div></td>
                    </tr>
                    <tr> 
                      <td height="310" valign="top">
<table width="462" border="0" align="center" background="image/login/bg.png">
                          <tr>
                            <td><hr width="96%" color="#f2f2f6"></td>
                          </tr>
                          <tr> 
                            <td> 
                              <table width="421" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
                                <tr> 
                                  <td width="8">&nbsp;</td>
                                  <td width="389"><div align="center"><img src="image/kindproduct.png" width="445"></div></td>
                                  <td width="9">&nbsp;</td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td>&nbsp; </td>
                          </tr>
                          <tr> 
                            <td width="378"> 
                              <?
//============ อ่านข้อมุลหมวด
$sqlCat="select * from 09521591category where 1=1 order by CatID asc ";
$queryCat=mysql_query($sqlCat);
echo"<table><tr>";
$i=0;
while($resutCat=mysql_fetch_array($queryCat))
{
$i++;
echo "<td>";
?>
                              <table width="180" height="134" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr> 
                                  <td height="60" valign="top"><div align="center"><a href="product.php?CatID=<?=$resutCat["CatID"];?>"><img src="picture/<?=$resutCat["Picture"];?>" width="60" height="60" border="0" /></a></div></td>
                                </tr>
                                <tr> 
                                  <td valign="top"><div align="center"> <a href="product.php?CatID=<?=$resutCat["CatID"];?>"> 
                                      <?=$resutCat["CategoryName"];?>
                                      <strong> 
                                      <?="(".num_record("09521591product","where 1 and CatID='".$resutCat["CatID"]."' ").")";?>
                                      </strong> </a></div></td>
                                </tr>
                              </table>
                              <?
	//============  แสดงแถวละ 3 ตัว
													echo"</td>";
									if(($i)%3==0)
									{
									echo"</tr>";
									}
									else
									{
									echo "<td>";
										}							  
}
echo"</tr></table>";
?>                            </td>
                          </tr>
                        </table>
                        <hr width="96%" color="#f2f2f6">
                        <br> 
                        <table width="465" border="0" align="center" background="image/login/bg.png">
                          <tr> 
                            <td> <table width="421" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
                                <tr> 
                                  <td width="8">&nbsp;</td>
                                  <td width="389"><div align="center"><img src="image/newproduct.png" width="403" height="40"></div></td>
                                  <td width="9">&nbsp;</td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td width="378"> 
                              <?
							  //============ อ่านรายการสินค้าล่าสุด
$sqlNewPro="select * from 09521591product  where 1=1 and New='Yes' order by ProductID DESC limit 0,6 ";
$queryNewPro=mysql_query($sqlNewPro);
echo"<table align=center><tr>";
$i=0;
while($resutNewPro=mysql_fetch_array($queryNewPro))
{
$i++;
echo "<td>";
?>
                              <table width="121" height="105" border="0" align="center" cellpadding="3" cellspacing="10">
                                <tr> 
                                  <td height="60" valign="top"><div align="center"><a href="detail.php?CatID=<?=$resutNewPro["CatID"];?>&ProductID=<?=$resutNewPro["ProductID"];?>"><img src="picture/<?=$resutNewPro["Picture"];?>" width="127" height="105" border="0"></a></div></td>
                                </tr>
                                <tr> 
                                  <td valign="top"><div align="center"> <a href="detail.php?CatID=<?=$resutNewPro["CatID"];?>&ProductID=<?=$resutNewPro["ProductID"];?>"> 
                                      <?=$resutNewPro["ProductName"];?>
                                      </a><br>
                                      ปกติ 
                                      <?="(<s>".number_format($resutNewPro["PriceNormal"], 2,'.',',')."</s>";?>
                                      บาท) <br>
                                      <font color="#FF0000"><strong>พิเศษ</strong></font> 
                                      <?="(".number_format($resutNewPro["Price"], 2,'.',',');?>
                                      บาท) <br>
                                      ค่าจัดส่ง 
                                      <?="(".number_format($resutNewPro["PriceSend"], 2,'.',',');?>
                                      บาท) </div></td>
                                </tr>
                              </table>
                              <?
	//============  แสดงแถวละ 2
													echo"</td>";
									if(($i)%2==0)
									{
									echo"</tr>";
									}
									else
									{
									echo "<td>";
										}							  
}
echo"</tr></table>";
?>                            </td>
                          </tr>
                        </table>
                        <hr width="96%" color="#f2f2f6">                      </td>
                    </tr>
                  </table></td>
                <td width="30%" valign="top">
                  <?php require_once('menuright.php'); ?>
                </td>
              </tr>
              <tr> 
                <td colspan="3" valign="top">
                  <?php require_once('down.php'); ?>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>




Tag : PHP, MySQL









ประวัติการแก้ไข
2011-09-10 15:38:33
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-09-10 15:34:26 By : shindo View : 1238 Reply : 6
 

 

No. 1



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



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


ส่วน connect กับ Function
Code (PHP)
<?
/*=============== ติดต่อฐานข้อมูล =================*/
$host="localhost";
$user_name="root";
$pass_word="";
$db="Bookzone2";
$admin_email = "[email protected]";
mysql_connect( $host,$user_name,$pass_word) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); 
mysql_query("SET NAMES UTF8");
mysql_query("SET character_set_connection=utf8");

?> 


Code (PHP)
<?php

					//============== Function ในการแทรกข้อมูล ==============
					function insert($field,$value,$table)
							{
									$sql = "INSERT INTO $table ($field) VaLUES ($value)";
									//echo $sql;
									$result= mysql_query($sql);
									return $result;
							}
							
					//============== Function ในการลบข้อมูล ==============
					function delete($table,$condition)
							{
								$sql ="delete from $table $condition";
								$result = mysql_query($sql);
								return $result;
							}
							
					//=============== Function ในการแก้ไขข้อมูล ==================
					function update($table,$command,$condition)
							{
									$sql = "UPDaTE $table SET $command $condition";
									$result = mysql_query($sql);
									return $result;
							}
							
					//=============== Function ในการเลือกข้อมูล ==================		
							function select($table,$condition)
							{
				
										$sql = "select * from $table $condition";
										//echo $sql;
										$dbquery = mysql_query($sql);
										$result= mysql_fetch_array($dbquery);
										return $result;
							}

					//=============== Function ในการเลือกข้อมูลทั้งหมด ==================	
							 function selectalldate($table,$condition,$listby)
						  {
									$sql = "select * from  $table  $condition $listby";
									//echo $sql;
									$dbquery = mysql_query($sql);
									return $dbquery;	
						  }
									
							//=============== select  Reccord Max or Min==================	// อาจจะใช้ในการ ดึง เฉพาะฟิวส์	 หรือรวมค่า นับค่า
							function selectMaxOrMin($maxormin,$field,$table,$condition)
							{
							
										$sql = "select $maxormin($field) as $field from $table $condition";
										$dbquery = mysql_query($sql);
										$result= mysql_fetch_array($dbquery);
										return $result;
							}
							
							//=============== Function ในการเลือกข้อมูล==================		
							function selectFistOrLast($table,$condition,$fieldlist,$bylist)
							{
							
										$sql = "select * from $table $condition order by $fieldlist $bylist";
										$dbquery = mysql_query($sql);
										$result= mysql_fetch_array($dbquery);
										return $result;
							}
							
							//=============== Function ในกาตรวจสอบตัวอักษรข้อมูล ==================
							function checkcharector($temp)
							{
							$temp=Trim(eregi_replace ( "'" , "" , $temp));
							$temp=Trim(eregi_replace ( "\"" , "&quot;" , $temp));
							return $temp;
							}
																				
							//=============== Function ในการนับจำนวนแถว ==================		
							function num_record($table,$condition)
							{
						
										$sql = "select * from $table $condition";
										$dbquery = mysql_query($sql);
										$num_rows = mysql_num_rows($dbquery);
										return $num_rows;
							}
							
						//=============== Function ในการนับตรวจสอบค่าว่าง ==================		
										function JscheckValueNull($form,$field,$msg)
										{
										echo"\nif(trim(document.$form.$field.value)=='')\n";
										echo"{\n";
										echo"alert('$msg');\n";
										echo"document.$form.$field.focus();\n";
										echo"return false;\n";
										echo"}\n\n";
										}
				
?>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-09-10 15:44:01 By : shindo
 


 

No. 2



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

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



ลองเปลี่ยนเป็น ANSI หรือ UTF-8 ครับ

Go to : ทำตามเว็ป PHP MySQL กับ Login Form แล้วติด Error ช่วยแก้หน่อยค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-09-10 17:04:24 By : webmaster
 

 

No. 3



โพสกระทู้ ( 2,249 )
บทความ ( 5 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook Hi5 Blogger

ใช้ nodepad++ เขียนหรือเปล่าครับ?
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-09-10 18:51:22 By : Manussawin
 


 

No. 4



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



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


ครับใช้ Notepad++ เขียน UTF-8 ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-09-11 11:59:06 By : shindo
 


 

No. 5



โพสกระทู้ ( 2,249 )
บทความ ( 5 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook Hi5 Blogger

นั่นไง ปัญหาคือตัว nodepad++ มันจะใส่อักขระก่อนฟังก์ชั่น session_start() ของเราครับเลยทำให้ error ซึ่งเราจะเปิดดูปกติไม่เห็นครับลองทำตามนี้นะครับ ปัญหา Cannot send session cache limiter headers already sent
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-09-11 18:32:12 By : Manussawin
 


 

No. 6



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

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


ครับ บางโปรแกรม default ที่ utf-8 with bom ต้องเลือก without-bom ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-09-11 21:00:48 By : ikikkok
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : เปลี่ยนชื่่อ table แล้วขึ้น Warning: session_start() [function.session-start]:
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่