note 119348 deleted from function.mysql-fetch-assoc by cmb

From: Date: Wed, 18 May 2016 14:04:35 +0000
Subject: note 119348 deleted from function.mysql-fetch-assoc by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-205508@lists.php.net to get a copy of this message
Note Submitter: jmeno ---- <html> <body> <form method="POST"> <input type="text" name="title"> <textarea name="content"></textarea> </form> <? $db = mysql_connect('localhost','username','password'); $data = filter_input_array(INPUT_POST); if(sizeof($data) > 0) { $title = $data["title"]; $content = $data["content"]; mysql_query("INSERT INTO tablename (title,content) VALUES('$title','$content')"); } $result = mysql_query("SELECT * FROM tablename"); while($row = mysql_fetch_assoc($result)) { echo "<div>"; echo "<h3>$row['title']</h3>"; echo "<p>$row['content']</p>" } ?> </body> </html>

« previous php.notes (#205508) next »