Thursday, December 22, 2011

Connect localhost with php

We use php language to connect sarver with MySql.

Code:

[php]

<?php
$con = mysql_connect("hostname","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
?>

[/php]

In apache sarver host name is "localhost", username is "root" and password is null ("") but in zend sarver host name is "localhost", username is "root" and password is "root123" what you have set.

1 comment:

  1. I just want to say I am beginner to blogging and site-building and certainly savored you're page. Likely I’m want to bookmark your blog . You absolutely have awesome writings. Thanks a bunch for sharing with us your web-site.

    ReplyDelete

Note: Only a member of this blog may post a comment.