I got to design a login and sign up form using yahoo webhosting.
I have designed the login page and the sign up page using html, but I have to write a .php module to save the entered fields in the “my database” table with table name “login”.
I have created the “login” table with the fields in the signup form. But I am not able to connect to the data base thorugh phpMyAdmin. I have written the following code in .php file
<? php
$db_host = "localhost";
$db_username = "user123";
$db_pass = "password123";
$db_name = "my database";
@mysql_connect("db_host","$db_username","$db_pass") or die ("could not connect to my database");
@mysql_select_db("$db_name") or die("no database");
echo "Successful Connection";
?>
But I am getting 500 – Internal Server Error. Why?
I have to establish a connection and update the values entered in signup form by writing the php code for it.
You are using variables as parameters for your MySQL functions, and so you don’t need (infact you shouldn’t) double quotes there!
Change
to