Hello
I've got a bit of PHP problem.
I'm trying to make a page that updates a row in a database. and another page reads from that row and gets its text from it.. some kind of easy posting/updating system.
But i've run into some really big problem.
Code:
<?php
$submit = $_POST['submit'];
$text = $_POST['text'];
$db = mysql_connect(localhost, ******, *****);
mysql_select_db(******);
if ($submit) {
$result = mysql_query("UPDATE pages SET lol = $_POST[text] WHERE id = '1'" );
} else{
?>
<form action="indexupdate.php" method="post">
Text <input type="text" name="text" size="30" style="width: 300px; height: 100px;">
<p><INPUT TYPE="Submit" name="submit" value="Change">
<?php
$submit = $_POST['submit'];
$lname = $_POST['text'];
} // end if
?>
Thats the code i've done so far. but it doesnt work, i cant however see anything wrong in it.
also, is there an easy way to make a page to read from database?
Thank you.