ค่าที่เราเช็ค จากเช็คบ็อกไม่ขึ้นค่ะ ทำยังไงคะ

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
um0000um
PHP Newbie
PHP Newbie
โพสต์: 1
ลงทะเบียนเมื่อ: 24/03/2016 2:17 pm

ค่าที่เราเช็ค จากเช็คบ็อกไม่ขึ้นค่ะ ทำยังไงคะ

โพสต์ที่ยังไม่ได้อ่าน โดย um0000um »

โค้ด: เลือกทั้งหมด

<form action="check_save.php" method="POST" >

 <tr>
     	<td valign="top">Relavant Keyfactor</td>
        <td>
        <?php
		 include("db_connect_edpex.php");
		 $sql = "SELECT * from keyfactor";
	
	   	 $objQuery = mysql_query($sql);
	     while($fetch = mysql_fetch_assoc($objQuery)){ ?>
        <li>
        <input type="checkbox" name="chkKey[]" 
        value="<?php echo $fetch["keyID"];?>"> <?php echo $fetch["keyName"];?>
        </li>
        <?php  } ?>
        <input type="submit" name="submit" id="submit" value="Submit"></td>
    </tr>
[attachment=0]test3.png[/attachment][attachment=0]test3.png[/attachment][attachment=0]test3.png[/attachment]
</form>
ไฟลเซฟ และโชว์

โค้ด: เลือกทั้งหมด

<?php   //save strength into db
include("db_connect_edpex.php");
if($_POST)
{
	 foreach($_POST['chkKey'] as $key=>$value)
	   {
		 $strID =5;
		 $sq1 = "INSERT INTO strengthkf(keyID, strID)
		 VALUES ('".$_POST['chkKey'][$key]."','".$strID."')"; //get keyID into strKF table 
		         
		 $qr= mysql_query($sq1) or die(mysql_error());
       } 
	   }  
?>
<?php 
		 $sql = "SELECT DISTINCT strengthkf.keyID FROM strengthkf where strengthkf.strID =5";
	     $objQuery = mysql_query($sql);
	  
	     while($result = mysql_fetch_array($objQuery)){ 
		   echo $result["keyID"];  
         
      	   $sql1 = "SELECT * from keyfactor";
           $obj = mysql_query($sql1);
           
		   while($fetch = mysql_fetch_array($obj)){ ?> 
        <li>  
        <input type="checkbox" name="chkKey[]" 
        value= "<?php $fetch["keyID"];?>" <?=($result["keyID"] == $fetch["keyID"] ? 'checked' : '')?>/> 
        <?php echo $fetch["keyName"];?>
        </li>  
         
		 <?php } ?>
<?php } ?>
 

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Google Adsense [Bot] และบุคลทั่วไป 81