| | |
What's wrong with this code?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2005
Posts: 4
Reputation:
Solved Threads: 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.
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.
this line should read or to be really good
PHP Syntax (Toggle Plain Text)
mysql_query("INSERT INTO nonmembers($name, $website, $comment)) VALUES(name, website, post_text) ");
PHP Syntax (Toggle Plain Text)
mysql_query("INSERT INTO nonmembers (name, website, post_text) VALUES ('$name', '$website', '$comment')");
PHP Syntax (Toggle Plain Text)
$sql = "INSERT INTO `nonmembers` (`name`, `website`, `post_text`) VALUES ('{$name}', '{$website}', '{$comment}'); mysql_query($sql) or die(mysql_error() . '<br>' . $sql);
![]() |
Similar Threads
- Can anyone figure out what is wrong in my program? (C++)
- What did I do wrong? (C++)
- Need help! With changing an equation into code and file opening (C++)
- Please help with login page code behind (ASP.NET)
- please help me!!been trying to trace where ive gone wrong!!! (C)
- Script stores data in wrong MySQL columns (MySQL)
- wrong output (C++)
- What is wrong wtih my css? (JavaScript / DHTML / AJAX)
- merged:nesting loops (C++)
Other Threads in the PHP Forum
- Previous Thread: Waht Is Rss Feeds
- Next Thread: phptriad+php5 latest version ?
Views: 1496 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cookies cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





