Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在数据表中执行创建、读取、更新、删除(CRUD)操作时刷新表_Php_Jquery_Mysql - Fatal编程技术网

Php 在数据表中执行创建、读取、更新、删除(CRUD)操作时刷新表

Php 在数据表中执行创建、读取、更新、删除(CRUD)操作时刷新表,php,jquery,mysql,Php,Jquery,Mysql,我有个问题 在数据表中执行创建、读取、更新、删除(CRUD)操作时如何刷新表 Screnshot表格: 标题代码/标题代码 <style type="text/css" title="currentStyle"> @import "../stylesheets/demo_table_jui.css"; @import "../stylesheets/ui-lightness/jquery-ui-1.8.4.custom.css"; </s

我有个问题 在数据表中执行创建、读取、更新、删除(CRUD)操作时如何刷新表

Screnshot表格:

标题代码/标题代码

        <style type="text/css" title="currentStyle">
    @import "../stylesheets/demo_table_jui.css";
    @import "../stylesheets/ui-lightness/jquery-ui-1.8.4.custom.css";
    </style>
    <script type="text/javascript" language="javascript" src="assets/js/jquery.js"></script>
    <script type="text/javascript" language="javascript" src="assets/js/jquery.dataTables.js"></script>

    <script type="text/javascript">
var rw = jQuery.noConflict();
rw(function() {
        rw('#ff').form({
            success:function(data){
                rw.messager.alert('Info', data, 'info');
            }
        });
    });
</script>

@导入“./stylesheets/demo_table_jui.css”;
@导入“./stylesheets/ui lightness/jquery-ui-1.8.4.custom.css”;
var rw=jQuery.noConflict();
rw(函数(){
rw('#ff')。表格({
成功:功能(数据){
rw.messager.alert('Info',data,'Info');
}
});
});
机构代码

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database, $koneksi);
$query_rs_datatables = "SELECT * FROM galeri";
$rs_datatables = mysql_query($query_rs_datatables, $koneksi) or die(mysql_error());
$row_rs_datatables = mysql_fetch_assoc($rs_datatables);
$totalRows_rs_datatables = mysql_num_rows($rs_datatables);
?>


没有人会费心去读你的代码墙。请将其缩短以确定具体问题。如果没有具体问题,请查看文档,如果有问题,请发布新问题。我不理解:(
        <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
  <thead>
  <tr>
    <th><center>Title</center></th>
        <th><center>Date</center></th>
            <th><center>Link Video</center></th>
                <th><center>Link Photo</center></th>
                    <th><center>Image</center></th>
                        <th><center>Action</center></th>
  </tr>
  </thead>
  <tbody>
  <?php do { ?>
    <tr>
      <td><center><?php echo $row_rs_datatables['judul']; ?></center></td>
        <td width="120px"><center><?php echo tgl($row_rs_datatables['tgl']); ?></center></td>

            <td align="center">
            <?php if ($row_rs_datatables['video']!=NULL){?>
                <ul class="inline-popups">
                    <p align="center"><a href="#youtube-popup-<?php echo $row_rs_datatables['id']; ?>" data-effect="mfp-zoom-in">LINK</a></p>
                </ul>

                    <!-- Youtube popup -->
                <div id="youtube-popup-<?php echo $row_rs_datatables['id']; ?>" class="video-popup mfp-with-anim mfp-hide">
                    <div class="video-wrapper">
                        <iframe src="http://www.youtube.com/embed/<?php echo $row_rs_datatables['video']; ?>" allowfullscreen></iframe>
                    </div><!-- /.video-wrapper -->
                </div>

                <?php } else { ?>
                <p align="center">-</p>
                <?php }?>
            </td>

            <td align="left">
            <?php if ($row_rs_datatables['linkfoto']!=NULL){?>
                <div class="magnific-popup-wrap">
                        <div class="col-xs-6 col-md-3">
                            <p align="center"><a class="zooming" href="<?php echo $row_rs_datatables['linkfoto']; ?>" title="<?php echo $row_rs_datatables['judul']; ?>">LINK</a></p>
                        </div>
                </div>
                <?php } else { ?>
                <p align="center">-</p>
                <?php }?>
            </td>

            <td align="left">
            <?php if ($row_rs_datatables['foto']!=NULL){?>
                <div class="magnific-popup-wrap">
                        <div class="col-xs-6 col-md-3">
                            <p align="center"><a class="zooming" href="../images/galeri/<?php echo $row_rs_datatables['foto']; ?>" title="<?php echo $row_rs_datatables['judul']; ?>">LINK</a></p>
                        </div>
                </div>
                <?php } else { ?>
                <p align="center">-</p>
                <?php }?>   

            </td>   

      <td>
        <center>

     <ul class="inline-popups">
     <a href="#popup-edit-<?php echo $row_rs_datatables['id']; ?>" data-effect="mfp-zoom-in" style="text-decoration:none"><i class="fa fa-wrench" title="Edit"></i></a> &nbsp; &nbsp; &nbsp; 
     <a href="#popup-delete-<?php echo $row_rs_datatables['id']; ?>" style="text-decoration:none"><i class="fa fa-trash-o" title="Delete"></i></a></ul>

        </center>

      <!-- Form popup Edit -->
        <div id="popup-edit-<?php echo $row_rs_datatables['id']; ?>" class="white-popup mfp-with-anim mfp-hide">
            <form action="" method="POST" > 

                                    <CENTER>EDIT GALLERY</CENTER><br/>
                                      <div class="form-group">
                                        <label for="exampleInputEmail1">Title Gallery</label>
                                        <input type="text" maxlength="50" class="form-control" id="addgallery" name="ti" value="<?php echo $row_rs_datatables['judul']; ?>" placeholder="Title Gallery">
                                     </div> 

                                     <div class="form-group">
                                        <label>Date</label>
                                        <input type="text" name="dt" class="form-control" value="<?php echo $row_rs_datatables['tgl']; ?>" readonly>
                                        </div><!-- /.form-group -->

                                                    <center><label for="exampleInputEmail1">You must choose one of the following</label></center><br/>
                                     <div class="form-group">
                                        <label for="exampleInputEmail1">Unique Link Youtube</label>
                                        <input type="text" value="<?php echo $row_rs_datatables['video']; ?>" class="form-control" id="un" name="yo" placeholder="Eg: HigyM915gw8">
                                     </div> 

                                     <div class="form-group">
                                        <label for="exampleInputEmail1">Link Photo</label>
                                        <input type="text" value="<?php echo $row_rs_datatables['linkfoto']; ?>"  class="form-control" id="li" name="li" placeholder="Link Photos">
                                     </div> 

                                    <div class="form-group">    
                                        <label for="exampleInputEmail1">Upload Photo</label>
                                    <div class="input-group">
                                        <span class="input-group-btn">
                                            <span class="btn btn-default btn-file">
                                                <i class="fa fa-camera"></i><input type="file" name="ph" >
                                            </span>
                                        </span>
                                        <input type="text" class="form-control" value="<?php echo $row_rs_datatables['foto']; ?>" readonly>
                                    </div></div>        

                                      <center>
                                      <button type="submit" class="btn btn-primary">Submit</button>  <button type="reset" class="btn btn-danger">Reset</button>
                                        </center>
                                       </form>
        </div>

              <!-- Form popup delet -->
        <div id="popup-delete-<?php echo $row_rs_datatables['id']; ?>" class="white-popup mfp-with-anim mfp-hide">
             <div class="form-group">
                <center><label for="exampleInputEmail1">Are You Sure Delete Gallery "<?php echo $row_rs_datatables['judul']; ?>" ?</label></center>
                <form action="" method="POST"> 
            </div>

                    <center><button type="submit" class="btn btn-primary">Yes</button></center>  <button type="button" title="Close (Esc)" class="mfp-close">x</button>

                </form>
        </div>

      </center>

     </td>
    </tr>
    <?php } while ($row_rs_datatables = mysql_fetch_assoc($rs_datatables)); ?>
   </tbody>
</table>





                </div><!-- /.container-fluid -->
                <?php
mysql_free_result($rs_datatables);
?>