Insert-Record
include("../connection.php");
class saverecords extends connection
{
function __destruct() { }
function getId1()
{
$qry="select max(id) from gallery";
$fire=mysql_query($qry,$this->conn);
while($rec=mysql_fetch_array($fire))
{
$maxid1=$rec["max(id)"];
}
return ($maxid1+1);
}
function dataAluminiStu($id,$name)
{
$fileName=$_FILES["fileUp"]["name"];
$fileTmpName=$_FILES["fileUp"]["tmp_name"];
$newPath=$fileName;
$qry=("insert into public_dis(id,name,image_url,thumbimg_url) values ('$id','$name','$newPath','$newPath')");
mysql_query($qry,$this->conn) or die("error .....");
if(file_exists("../images/gallery/"))
{
move_uploaded_file($fileTmpName,"../images/gallery/".$fileName);
//this function is used to copy one place to another place.
}
else
{
mkdir("../images/gallery/");
move_uploaded_file($fileTmpName,"../images/gallery/".$fileName);
// this function is used to deleted file parmanantly..
}
}
}
?>
include("header.php"); ?>