Dobrý den, mám problém s vložením dat z CK editoru ze textarey do databaze, pokaždé to vytvoří jen pouze novou hodnotu bez textu. sql phpmyadmin screen: http://prntscr.com/fqs9z8
index.php
<script src="ckeditor/ckeditor.js"></script>
<form action="Editpanel.php" method="post">
<textarea class="ckeditor" name="editor"></textarea>
<input type="submit" name="subimt" action="action.php" value="INSERT">
<?
if(isset($_POST['submit']))
{
$title = $_POST['editor'];
$article = $_POST['editor'];
mysql_query("INSERT INTO blog (title, article) VALUE('$title', '$article')");
}
//*
// Connection
{
$text = $_POST['editor1'];
// connection to Database SQL
// server= localhost, conUsername= root, DBPasword'', DBName=editor
$con = mysqli_connect('localhost','05456','X_!SD152?.','10362') or die("ERROR");
// Insert Data to
$query = mysqli_query($con, "INSERT INTO content (content) VALUES ('$text')");
if($query)
{
echo "ADDED INTO DB";
}
else
{
echo "ERROR WHILE INSERTING";
}
}
?>
Action.php
<?php
echo strip_tags($_POST['test1']); // default *: test1
$content = mysql_real_escape_string($_POST['test1']); // default *: test1
mysql_connect("localhost","c705456","f15dD152?.");
$conn = mysql_select_db("80710362"); // default: test1
$query = "INSERT INTO yourtablename VALUES('','$content')"; //Default: $content
echo $query;
if(mysql_query($query))
{
echo "inserted";
}
else
{
mysql_error();
}
$display = "select * from yourtablename";
$res = mysql_query($display);
if($res)
echo "true"; // Default: True =
else
echo mysql_error();
while ($result = mysql_fetch_row($res)) {
echo $result[1];
}
?>
Nemohu najít kde je problém. Díky za pomoc