permanent display of content

+1 Mubarik Yusif · January 1, 2016
Please I've created a social site where users can post text to the data base and have echoed to them. But text echoed are just temporal and get erased or replaced when new one is added please help asap cos am new to programming and that's my first website......

Post a Reply

Replies

Oldest  Newest  Rating
+1 Mubarik Yusif · February 3, 2016
OK how do I not insert at the same place
+2 Jagdeep Matharu · January 19, 2016
INserting at same place
+1 Mubarik Yusif · January 19, 2016
<?php
require 'connect.inc.php';
mysql_connect('localhost','root','');
mysql_select_db('a_database');

if (isset($_POST['text'])) {
$text = $_POST['text'];
if (!empty($text)) {


$query = "INSERT INTO `data` VALUES ('', '".mysql_real_escape_string($text)."')";
if ($query_run = mysql_query($query)) {
echo $text;
} else {
echo 'Failed';
}

} else {
echo 'Please type something.';
}
}

?>

@Jonah Morrison that's my code
+1 Jonah Morrison · January 11, 2016
Could you post what code you have so far? Its kind of hard to answer with nothing to look at!
+1 Mubarik Yusif · January 4, 2016
Yes they have ID's
+1 Chong Zhi Rui · January 2, 2016
Do your database table that stores your posts have a unique ID?
  • 1

HTML / CSS / Web Design

107,333 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators