Sunday, September 12, 2010

Free hosting in php

I think one of the best free hosting site will be awardspace. Awardspace gives you 200MB free space with  mailing accounts where you can receive mails only but you cannot send mails.The default front page will be index.php.They allow to use FTP accounts that you can upload your with cute ftp.In this you are not able to edit php.ini file.
Continue Reading...

Saturday, September 11, 2010

Creating a database in mysql

Continue Reading...

How to connect php to SQL database

<?php
$myServer = "localhost";
$myUser = "your_name";
$myPass = "your_password";
$myDB = "examples";

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with

$selected = mssql_select_db($myDB, $dbhandle)
  or die("Couldn't open database $myDB");

//declare the SQL statement that will query the database
$query = "SELECT id, name, year  FROM cars WHERE name='BMW'";

//execute the SQL query and return records
$result = mssql_query($query);

$numRows = mssql_num_rows($result);
echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>";

//display the results
while($row = mssql_fetch_array($result))
{
  echo "<li>" . $row["id"] . $row["name"] . $row["year"] . "</li>";
}
//close the connectionmssql_close($dbhandle);
?>



Here mssql_connect is the function for making connection with mysql and php we need pass the values like username, password  and databases name. If you are using XAMP as the server you need to give root as user name no need to give the password.I will tell you how to make a data base in next post.
Continue Reading...

Friday, September 10, 2010

Synatx for PHP

We start php with symbol <? and end with with ?>.
Let us look how to write a simple php to print your name
first you need to write html

<html>
<body>

<?
echo "This is to show how to print";
?>

</body>
</html>

here echo is the function to print to screen in php.save this code as leason1.php and run on your server
Continue Reading...

PHP basics

Let us study PHP, PHP is a very simple language.It is a powerful language for developing websites. PHP is called the Hypertxt preprocessor.You just need some basic knowledge about HTML language to study PHP. Let us look what all are the tools you need to run php as localhost.
1 .Server (You need an Apache server or any sever to run php,click here to download XAMP)
2. Notepad or Dreamwever

PHP is an open source softwarePHP is free to download and use.PHP file is saved as .php and it can be placed in the html code.



Continue Reading...
 

Blogroll

Site Info

Text

Free PHP Scripts Copyright © 2009 WoodMag is Designed by Ipietoon for Free Blogger Template