<div style='background-color: none transparent;'></div>
Home » » sql php code

sql php code



$host = "localhost";
$user = "root";
$password = "root";
$database = "komal";
$connection = mysql_connect($host,$user,$password)
or die("Could not connect: ".mysql_error());
mysql_select_db($database,$connection)
or die("Error in selecting the database:".mysql_error());
$array = array(1,2,3,4);
foreach ($array as $value){
$sql="Select * from stu where id =".$value;
$sql_result=mysql_query($sql,$connection)
or exit("Sql Error".mysql_error());
$sql_num=mysql_num_rows($sql_result);
echo "";
echo "";
echo "";
echo "";
while($sql_row=mysql_fetch_array($sql_result)) {
$id=$sql_row["id"];
$name=$sql_row["name"];
echo "";
echo "";
}
echo "
Id Name
".$id."".$name."

";
}
?>

Share this article :
 
Copyright © 2011. B.Sc B.Tech MCA Ploytechnic Mini,Main Projects | Free Main Projcets Download | MCA |B.tech . All Rights Reserved
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Template Modify by Creating Website. Inpire by Darkmatter Rockettheme Proudly powered by Blogger