Skip to main content

PHP Code to Connect Mysql Database

Php mysql connectivity code.............


Write below code in connect.php file


<?Php
ob_start();
$host="localhost:3307"; // Host name
$username="root"; // Mysql username
$password="sa"; // Mysql password
$db_name="dbname"; // Database name
$tbl_name="login"; // Table name
?>

include your connect file in page


include ("config.php");
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

execute your query

$quer2=mysql_query("SELECT * FROM village");
$noticia2 = mysql_fetch_array($quer2);

and that's it .....
www.indbricks.com


Comments

Popular posts from this blog

Upload Photo to server using Android and .Net

In this example with image we are passing some string also like name and description as well as we have Radio button also which is use too map different upload location . Step by step:- 1>                                                  First will be design which is our XML file name photo_upload.xml <? xml version = "1.0" encoding = "utf-8" ?> < ScrollView xmlns:android = "http://schemas.android.com/apk/res/android"     android:layout_width = "fill_parent"     android:layout_height = "fill_parent"      android:orientation = "vertical"     android:fillViewport = "true" >     < RelativeLayout      ...

Android App To Send Free Message.

Android App To Send Free Message. Hi Friends I Have developed Android app to send Free Message from your Mobile . Now I have developed with only one provider "Way2Sms" . So Download from this link  http://www.exlvis.com/ FreeSmsandroid.aspx   and chk it out and give your Feedback So We can Customize and after we provide with All Providers. http://www.exlvis.com/ FreeSmsandroid.aspx Thanks Rajmal Kulmi Exlvis  Solutions Pvt. Ltd.