hello
i want if enter account save in database :)
this is my code , but it's not save anything in database :"(
i don't know why !
i have database "accounts" have "2 row name & account"
<html>
<body>
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('can not connect'.mysql_error());
}
mysql_select_db("scms", $con );
?>
<form action='' method='POST'>
<table BORDER="0">
<tr>
<td>facbook account :</td>
<td><input type="text" name="facebook" maxlength="50"/></td>
<td><input type="SUBMIT" name="save1" value="save"/></td>
</tr>
<tr>
<td>twitter account :</td>
<td><input type="text" name="twitter" maxlength="50"/></td>
<td><input type="SUBMIT" name="save2" value="save"/></td>
</tr>
</table>
</form>
<?php
if(name=="save1")
{
$accout_f = $_POST[facebook];
mysql_query("INSERT INTO accounts (account) VALUES ('$accout_f') WHERE name=facebook");
}
elseif(name=="save2")
{
$accout_t = $_POST[twitter];
mysql_query("INSERT INTO accounts (account) VALUES ('$accout_t') WHERE name=twitter");
}
?>
</body>
</html>