Hi I am a newbie to PHP so please help
How do I add information into my mysql db?
I have a db called sitedb and I want to insert datat into my news table
inside my sitedb.
code snippet:
<html><head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="<?=$PHP_SELF;?>" method="post" name="news">
<p> NAME
<input name="author" type="text" id="author" maxlength="30">
</p>
<p> your news
<textarea cols="50" rows="10" name="body" type="text" id="body"
maxlength="60"> </textarea>
</p>
<?
include ("broadcast.inc");
?>
<p><input type="submit" name="Submit" value="Submit"></p>
<?
// this inserts the data into the table news, and the rows within that table
mysql_query("INSERT INTO news (author, posted, body) VALUES($author,
$posted, $body) ");
// Close the connection
mysql_close();
?>
</form>
</body>
</html>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php