Jump to content

liontas

New Members
  • Posts

    4
  • Joined

  • Last visited

liontas's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have install CKEDITOR to output text.Now i want to retrieve this text from SQL DB and insert into CKEDITOR for changes and updates.The value that I need to pass is $post_article.`The code below: <div class="form-group" id="article"> <label>ΚΕΙΜΕΝΟ</label> <textarea class="form-control" name="post_article" cols="30" rows="20"></textarea> <script>CKEDITOR.replace( 'post_article' ); CKEDITOR.instances.post_article.setData( '<p><?php echo $post_article;?></p>'); </script> </div> Unfortunately it doesn't work.Any suggestions or solutions? Thanks.
  2. The code : <?php global $connect; $connect= mysqli_connect('localhost', 'root','','andreas'); if (!$connect){ die('FAILED'. mysqli_error($connect)); } $the_post_id='46'; $query="SELECT * FROM posts WHERE post_id=$the_post_id "; $select_posts_by_id= mysqli_query($connect, $query); while($row= mysqli_fetch_assoc($select_posts_by_id)){ $post_title=$_row['post_title']; $post_keimeno=$_row['post_keimeno']; $post_publisher=$_row['post_publisher']; $post_cat_title=$_row['post_cat_title']; $post_image=$_row['post_image']; $post_date= $_row['post_date']; } var_dump($the_post_id); var_dump($select_posts_by_id); var_dump($row); var_dump($post_title); ?> The effect below: Notice: Undefined variable: _row in C:\xampp\htdocs\newstheme\admin\includes\test.php on line 18 Notice: Undefined variable: _row in C:\xampp\htdocs\newstheme\admin\includes\test.php on line 19 Notice: Undefined variable: _row in C:\xampp\htdocs\newstheme\admin\includes\test.php on line 20 Notice: Undefined variable: _row in C:\xampp\htdocs\newstheme\admin\includes\test.php on line 21 Notice: Undefined variable: _row in C:\xampp\htdocs\newstheme\admin\includes\test.php on line 22 Notice: Undefined variable: _row in C:\xampp\htdocs\newstheme\admin\includes\test.php on line 23 string(2) "46" object(mysqli_result)#2 (5) { ["current_field"]=> int(0) ["field_count"]=> int( ["lengths"]=> NULL ["num_rows"]=> int(1) ["type"]=> int(0) } NULL NULL What happens? Thanks a lot.
  3. Here is the code.The problem is that when i check the checkbox automatically unchecked and I am try to input the values of checkboxes to datable without submitting via button. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Lumino - Tables</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/datepicker3.css" rel="stylesheet"> <link href="css/bootstrap-table.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--Icons--> <script src="js/lumino.glyphs.js"></script> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <script src="js/respond.min.js"></script> <![endif]--> </head> <body> <!--Header--> <?php include 'includes/header.php'; include '../main_includes/connect_db.php'; include 'includes/functions.php'; ?> <!--end Header--> <!-- .SIDEBAR --> <?php include 'includes/sidebar.php'; ?> <!--/.sidebar--> <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main"> <div class="row"> <ol class="breadcrumb"> <li><a href="#"><svg class="glyph stroked home"><use xlink:href="#stroked-home"></use></svg></a></li> <li class="active">Icons</li> </ol> </div><!--/.row--> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Tables</h1> </div> </div><!--/.row--> </div> <form action="" method="post"> <table class="table table-bordered table-hover" id="pinakas"> <thead> <tr> <th class="titlos"><input style="margin-left: 3px;" type="checkbox" name="checkboxAllBoxes" id="checkboxAllBoxes "></th> <th class="titlos">POST_ID</th> <th class="titlos">ΚΑΤΗΓΟΡΙΑ</th> <th class="titlos">ΤΙΤΛΟΣ</th> <th class="titlos">ΚΕΙΜΕΝΟ</th> <th class="titlos">FILE</th> <th class="titlos">ΕΚΔΟΤΗΣ</th> <th class="titlos">ΗΜΕΡ.</th> <th class="titlos">UPDATE</th> <th class="titlos">DELETE</th> </tr> </thead> <?php global $connect; $query="SELECT * FROM posts ORDER BY post_date DESC "; $select_posts= mysqli_query($connect, $query); while($row= mysqli_fetch_assoc($select_posts)) { $post_id=$row['post_id']; $post_cat_title=$row['post_cat_title']; $post_title=$row['post_title']; $post_keimeno= substr($row['post_keimeno'], 0, 60); $post_publisher=$row['post_publisher']; $post_image=$row['post_image']; $post_date=$row['post_date']; $post_check=$row['post_check']; echo "<tr>";?> <td><input type='checkbox' name="checkbox" id="<?php echo $post_id; ?>" value="txt" onchange="check(this);"></td>; <?php echo "<td class='keli'><strong>$post_id</td>"; echo "<td class='keli'>$post_cat_title</td>"; echo "<td class='keli'>$post_title</td>"; echo "<td class='keli'>$post_keimeno</td>"; echo "<td><img src='../images/$post_image' height='50' witdth='50'></td>"; echo "<td class='keli'>$post_publisher</td>"; echo "<td class='keli'>$post_date</td>"; ?> <td><a href="tables.php?source=tables&update=<?php echo $post_id; ?>">UPDATE</a></td> <td><a href="tables.php?source=tables&delete=<?php echo $post_id; ?>">Delete</a></td> </tr> <?php } ?> </table> </form> <div class="button"> <!--<button class="koumpi" type="submit" name="submit">SUBMIT</button>--> <button type="submit" name="delete"class="btn btn-primary">Delete</button> <button type="submit" class="btn btn-primary" name="update" style="background-color: green;">UPDATE</button> <button type="submit" class="btn btn-primary">Submit Button</button> </div> <!--/.row--> <!--/.main--> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/chart.min.js"></script> <script src="js/chart-data.js"></script> <script src="js/easypiechart.js"></script> <script src="js/easypiechart-data.js"></script> <script src="js/bootstrap-datepicker.js"></script> <script src="js/bootstrap-table.js"></script> <script> function check(ch){ if(ch.checked){ window.location.href = "tables.php?source=tables&checkbox="+ch.id+"&value=checked"; //windows.location.replace("http://yahoo.com"); } else{ window.location.href = "tables.php?source=tables&checkbox="+ch.id+"&value=unchecked"; } } </script> <!--/.main--> </body> </html>
  4. Hi guys I have this CMS table and i want when i check a checkbox (as refers to an id) to send value to database field as "checked".Because i tried a lot and i can't find solution is there any way to fix this?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.