 |
ถ้าต้องการเก็บข้อมูลจาก Range ลง database ต้องทำยังไงครับ |
|
 |
|
|
 |
 |
|

อย่างข้อความเก็บจากการ Post แต่ยังนี้จะเก็บยังไง ครับ
Code (PHP)
<label class="txt-head">ความถนัด:</label> <input type="text" class="inputs" name="skill_bold" id="skill_bold" placeholder="ลำดับ"><br>
<label class="txt-head">ระดับความสามารถ:</label> <div id="range"><span id="currentVal">5</span></div></center>
<script type="text/javascript">
(function() {
$("#range").slider({
range: "min",
max: 10,
value: 5,
slide: function(e, ui) {
$("#currentVal").html(ui.value);
}
});
}).call(this);
</script>
<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple2").jRating({
type:'small', // type of the rate.. can be set to 'small' or 'big'
length : 40, // nb of stars
decimalLength : 1 // number of decimal in the rate
});
});
</script>
Code (PHP)
<?php
$sql="insert into tb_skill(skill_bold,skill_level,dc_profile) values('$_POST[skill_bold]','$_SESSION[sess_user_id]')";
$query=mysql_query($sql);
if($query){
echo "บันทึกข้อมูลสำเร็จ";
}
else{
echo "บันทึกข้อมูล ไม่ สำเร็จ";
}
?>
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2015-03-02 17:04:45 |
By :
Hawxeye |
View :
802 |
Reply :
8 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ที่หัวโปรแกรม ลองคำสั่งนี้
<?php
print_r($_REQUEST); exit;
|
 |
 |
 |
 |
Date :
2015-03-02 21:26:41 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|