½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
CSS
html
mysql
jquery
image
API
Mobile
¸Þ´º
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 284 | Á¶È¸¼ö 6,202 | µî·ÏÀÏ 2018-07-05 17:39:15

´Ð³×ÀÓ

phpÃʺ¸ÀÚ

À̸ÞÀÏ

any9785@naver.com

Á¦¸ñ

php °í¼ö´Ôµé ¼Ò½ºÁ»ºÁÁÖ¼¼¿ä..
³»¿ë

php Ãʺ¸ÀÚÀÔ´Ï´Ù...
mysql¿¡´Â Á¤»óÀûÀ¸·Î ¿¬°áÇߴµ¥ À¥¿¡¼­ °á°ú°ªÀÌ ¾Æ¹«°Íµµ ¾È³ª¿É´Ï´Ù.
¹è¿­¿¡¼­ ¹®Á¦°¡ »ý±ä°Å °°Àºµ¥ ÇØ°áÀ» ¸øÇÏ°í ÀÖ½À´Ï´Ù.
Ʋ¸°ºÎºÐÀÌ ÀÖ´Ù¸é ÀÚ¼¼ÇÏ°Ô ¼³¸íÀ» ÇØÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù.

dbconnºÎºÐ
¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ
<?php
$db_host='127.0.0.1';
$db_user='root';
$db_pw ='qwe123';
$db_name='alram';

$dbconn = mysqli_connect ( $db_host, $db_user, $db_pw, $db_name) or die ( "MySQL¿¡ Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù." );
mysqli_select_db ( $dbconn, $db_name ) or die ( "DB¿¡ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù." );

set_time_limit ( 0 );

?>
¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ
¸ÞÀÎphp ºÎºÐ
<?php
 include_once "dbconn.inc";
 
    if(isset($_GET['action'])) // °ªx
 if(isset($_GET['_id']))
 if(isset($_GET['br_broadcast']))
 if(isset($_GET['br_category']))

 if(isset($_GET['br_alarm']))
 if(isset($_GET['br_alarm_time']))
 
 if($action == "get_broadcast_list") {
  //¹æ¼Û»ç,À帣¿¡ ¸Â´Â ¹æ¼Û ¸ñ·ÏÀ» °¡Á®¿Â´Ù.
  $_sql = "SELECT * FROM br_broadcast_info_table WHERE br_broadcaster='$br_broadcaster' AND br_category='$br_category'";
  
  /*$result = mysql_query($_sql, $dbconn);*/
  $result = mysql_query("SELECT * from alram");
  
  if(!$result){
   die(mysql_error());
  }
  
  
  $resultJsonArr = array();
 
  for($i = 1; $i = mysql_fetch_array($result); $i ++) {
   $_resultJsonArr [i] = $list[_id];
   $_resultJsonArr [i] = $list[br_name];
   $_resultJsonArr [i] = $list[br_broadcaster];
   $_resultJsonArr [i] = $list[br_category];
   $_resultJsonArr [i] = $list[br_start_time];
   $_resultJsonArr [i] = $list[br_day];
   $_resultJsonArr [i] = $list[br_info];
   $_resultJsonArr [i] = $list[br_alarm];
   $_resultJsonArr [i] = $list[br_alarm_time];
   
   array_push( $resultJsonArr, $_resultJsonArr );
  }
  $resultJsonArr[] = $_resultJsonArr;

  
  echo json_encode($resultJsonArr);
 }
   else if($action == "update_br_alarm") {
  //¾Ë¶÷Á¤º¸¸¦ ¾÷µ¥ÀÌÆ®ÇÑ´Ù.
  $_sql = "UPDATE br_broadcast_info_table SET br_alarm=$br_alarm, br_alarm_time=$br_alarm_time WHERE _id=$_id";
  
  $result = mysql_query($_sql, $dbconn);
  
  if(!$result){
   die(mysql_error());
  }
 }else if($action == "get_broadcast_alarm_time") {
  //¾Ë¶÷ ¼³Á¤ ½Ã°£À» °¡Á®¿Â´Ù. (¸îºÐÀüÀÎÁö)
  $_sql = "SELECT br_alarm_time FROM br_broadcast_info_table WHERE _id=$_id";
  
  $result = mysql_query($_sql, $dbconn);
  
  if(!$result){
   die(mysql_error());
  }else {
   $list = mysql_fetch_array ( $result );
   $_alarm_time = $list [br_alarm_time];
   
   echo $_alarm_time;
  }
 }
 mysqli_close($dbconn);
?>

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
°ü¸®ÀÚ 2018-07-10 09:37:20
´ä±Û

mysql_fetch_array »ç¿ë¹ýÀÌ À߸øµÈ°Å °°½À´Ï´Ù.

$result = mysql_query($query,$dbconn);

while ( $data = mysql_fetch_array($result) )
{
$_reulstjsonArr[$i] = $data[fieldname];
}

ÇüÅ·Πwhile ¹®À» ÀÌ¿ë Çغ¸¼¼¿ä.

°ü¸®ÀÚ 2018-07-10 09:38:01
´ä±Û

¼Ò½º¸¦ ¸ðµÎ »ìÆ캸Áø ¾Ê¾Ò´Âµ¥ ´«¿¡ ¶ç´Â ºÎºÐÀÌ ÀÖ¾î ¾Ë·Áµå¸° ºÎºÐÀÌ°í,
¿¡·¯¹®ÀÌ ¾î¶»°Ô ³ª´ÂÁö
ȤÀº Áõ»óÀÌ ¾î¶»°Ô ³ª´ÂÁö ³²°ÜÁÖ½Ã¸é ´Ù½Ã Çѹø ºÁµå¸±²²¿ä

ÀÌÀü°Ô½Ã±Û ÀÌ°ÅÁ» ÇØ°áÇØ ÁÖ¼¼¿ä ¤Ì¤Ì 2017-11-01 19:57:30
´ÙÀ½°Ô½Ã±Û ÁÖ°£ °Ô½Ã±Û Á¶È¸¼ö ·©Å· 2018-07-17 15:11:36