Undefined variable.
Posted: Fri Nov 19, 2010 3:10 am
Hi,
I am trying to execute the below code but getting these errors :
Notice: Undefined variable: mysql_query in C:\wamp\www\process.php on line 16
Fatal error: Function name must be a string in C:\wamp\www\process.php on line 16
Code:
<html><body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("encryption") or die(mysql_error());
$username = $_POST['username'];
$password = $_POST['password'];
$mysql_query("INSERT INTO login (username,password) VALUES ('$username','$password')") or die(mysql_error());
?>
</body></html>
`
$_POST['username'] &
$_POST['password'] come from a previous page. I have no problem with that. Please help.. Thanks in advance.
I am trying to execute the below code but getting these errors :
Notice: Undefined variable: mysql_query in C:\wamp\www\process.php on line 16
Fatal error: Function name must be a string in C:\wamp\www\process.php on line 16
Code:
<html><body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("encryption") or die(mysql_error());
$username = $_POST['username'];
$password = $_POST['password'];
$mysql_query("INSERT INTO login (username,password) VALUES ('$username','$password')") or die(mysql_error());
?>
</body></html>
`
$_POST['username'] &
$_POST['password'] come from a previous page. I have no problem with that. Please help.. Thanks in advance.