Saturday 16 August 2014

how to retrieve data of ckeditor from database

In our last tutorial of how to get data of ckeditor ckeditor text input insert into database full source code
this is part one which explain how to store ckeditor's text into database.We are PHP and MYSQL.

cktext table file for database ckeditor This is for database 


 explanation of how to retrieve saved data of ckeditor from database

only change in add.php file


$sql="INSERT INTO cktext (papername,email,subject,section,description,upload,uploadtext)

if (!mysql_query($sql,$con))
  die('Error: ' . mysql_error());
echo "Question paper uploaded Successfully</br> YOUR TEXT IS";
$data = mysql_query("SELECT * FROM cktext") or die(mysql_error()); Print "<table border cellpadding=3>";

while($row = mysql_fetch_array( $data ))
 Print "<tr>"; Print "<th>Name:</th> <td>".$row['papername'] . "</td> ";

 Print "<th>Blog:</th> <td>".$row['uploadtext'] . " </td></tr>";

echo "--------------------------------<br>";
echo "EMAIL ID :{$row['email']}  <br> ".
         "description : {$row['description']} <br> ".
         "upload : {$row['upload']} <br> ".

 } // end of while
Print "</table>";

 }//first if isset


-------------------------------------------THE END-----------------------------

 } // end of while
Print "</table>";   <<<<<< END OF TABLE AFTER WHILE CLOSING


You can print BLOG in new line

while($row = mysql_fetch_array( $data ))
 Print "<tr>"; Print "<th>Name:</th> <td>".$row['papername'] . "</td></tr>";

Print "<tr>"; Print "<th>Blog:</th> <td>".$row['uploadtext'] . " </td></tr>";

No comments:

Post a Comment