php - Lost on HTML5 database connections -


i still new in html5 , barely starting out. did html awhile module school , did simple "online-shopping" site can use jsp files communicate server. html5 entirely whole new ball game me, hope stackoverflow community able me out queries.

so, did reading on websockets lost in area. know websockets not entirely sure is. example, in examples have read, taught me how create new websocket object or how have connection between websocket object, , there supposed url. example of code this,

var socket = new websocket(url, [protocal] ); 

so fill in "url" area? put ip of server or have direct php or html file, etc? have downloaded wamp , use apache server. possible or have use node.js? in way have no idea "websocket" means. "server" or feature within "server" or package bridges connection between server?

and there other alternatives using similar jsp in html5 server data storage?

thanks in advance replies.

the basic way connect database using mysql range of functions built php.

here function database_connect()

public function database_connect($database_location, $database_user, $database_password, $database_name) {     mysql_connect($database_location, $database_user, $database_password) or die(mysql_error());     mysql_select_db($database_name) or die(mysql_error()); } 

just paste function @ top of page or in include file, , connect database calling in 1 line:

database_connect('localhost', 'username', 'password', 'database'); 

this simplest way connect sql database, hope looking for! remember code in php


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -