/    Sign up×
Community /Pin to ProfileBookmark

sending to database

I am trying to send form info to a database.

[code=php]<body>
<?php
$host=”localhost”;
$user=”root”;
$pass=”password”;
mysql_connect($host,$user,$pass);

if($submit)
{
mysql_select_db(“movies”);
$result=MYSQL_QUERY(“INSEERT INTO new (name,email)” . “VALUES (‘$name’,’$email’)”);
print “$name was added”;
}
?>
</body>[/code]

form

[code=php]<form action=”sql.php” method=”post”>
<p><input name=”name” value=”name” type=”text”/></p>
<p><input name=”email” value=”email” type=”text”/></p>
<p><input name=”submit” value=”submit” type=”submit”/></p>
</form>[/code]

it comes up with the print message but nothing adds;

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@solavarApr 23.2004 — You've a typing error in the SQL statement:

You've "[COLOR=red]INSEERT[/COLOR] "
Copy linkTweet thisAlerts:
@chris9902authorApr 23.2004 — i would drop kick my ass if i could.

thank you.
×

Success!

Help @chris9902 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...