+ 4
how can i connect HTML page to database?
describe me anybody that, how to insert data from HTML page to database...?
6 Antworten
+ 6
What do you mean by 'directly'? HTML is not a programming language, so it is not possible to connect to a database using only the markup language.
You need another language that can establish a connection and get the results of the query you use. You can use Java, PHP, Javascript, Python, Ruby and basically just about any language.
+ 3
You can not do it, for that you need a language that works on the server side.
+ 2
Mickel Sánchez. like Servlet
but, you have any other idea? directly interact to database...
+ 1
okay
you mean we can't connect to database without established connection between frontend and back backend.
thanks for your answer...
0
Use this PHP code..
save it as connection.php.
For further information, contact me.
<?php
$con = mysql_connect(localhost,"root","") or die(mysql_error());
$db = mysql_select_db("Database name here",$con) or die(mysql_error());
function protect($string)
{
$string = mysql_real_escape_string($string);
return $string;
}
?>