0

<form action="php.php?b=<?php echo $b; ?>" method="post">

Enter your news/rumor:
<input type="text" name="name" />
Enter your news/rumor:
<input type="text" name="website" />
Enter your news/rumor:
<input type="text" name="comment" />
<input type="submit" />
</form><br />

then on php.php:

$t=$_GET["b"];
mysql_connect("db.lepslair.com", "username", "my password");
mysql_select_db("lepslair");
mysql_query("INSERT INTO nonmembers($name, $website, $comment)) VALUES(name, website, post_text) ");

I'm not getting any errors thrown at me, but the database doesn't retain any of the information.

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by leprakhauns
0

this line

mysql_query("INSERT INTO nonmembers($name, $website, $comment)) VALUES(name, website, post_text) ");

should read

mysql_query("INSERT INTO nonmembers (name, website, post_text) VALUES ('$name', '$website', '$comment')");

or to be really good

$sql = "INSERT INTO `nonmembers` (`name`, `website`, `post_text`) VALUES ('{$name}', '{$website}', '{$comment}');
mysql_query($sql) or die(mysql_error() . '<br>' . $sql);
0

LMAO I should have known that, thanks for pointing it out. It works now thanks a lot.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.