Showing posts with label two. Show all posts
Showing posts with label two. Show all posts

Thursday, May 19, 2016

How to Join Two Separate Databases in PHP Using Join Query

This is a common problem faced by many PHP/MySQL Developers.Sometimes you need to retreive data from 2 different databases and save them in a file.But the main problem here is that Config file points to only one database.So how do you join the two databases with your query.The below given PHP Code just does that for you.It shows you, how you can write a query to Join 2 separate database and fetch the required information.
<?php include "/home/db1/connections.php";?>
<?php
$db = "DATABASE1 NAME"; // name of the db
$host = $_SERVER[secret_db_host]; // db host name
$user = "DATABASE1 USERNAME"; // db username
$password = "DATABASE1 PASSWORD"; // db password
$object= new mysql($host, $user, $password, $db);
$object->connect();
$object->select();
$sql = "SELECT email, first_name, last_name FROM em_subscriber ORDER BY first_name";
$object->query($sql);
while($object_res = $object->fetchObject())
{
$emails[]=$object_res->email;
$contents.=$object_res->first_name." ";
$contents.=$object_res->last_name." ";
$contents.=$object_res->email." ";
$contents.=$answer." ";
}


$db = "DATABASE2 NAME"; // name of the db
$host = $_SERVER[secret_db_host]; // db host name
$user = "DATABASE2 USERNAME"; // db username
$password = "DATABASE2 PASSWORD"; // db password
$object= new mysql($host, $user, $password, $db);
$object->connect();
$object->select();
$sql = "SELECT firstname,
lastname,
emailaddress,
date_of_birth,
postcode,
new_bookings.checkin_date AS booking_date,
new_bookings.id AS b_id
FROM customers
LEFT OUTER JOIN new_bookings
ON new_bookings.customer_id = customers.customer_id
GROUP BY customers.customer_id
ORDER BY lastname";
$object->query($sql);
while($object_res = $object->fetchObject())
{
if (!in_array($object_res->emailaddress, $emails))
{
$contents.=$object_res->firstname." ";
$contents.=$object_res->lastname." ";
$contents.=$object_res->emailaddress." ";
$contents.=$object_res->postcode." ";
$contents.=$object_res->date_of_birth." ";
$contents.=$object_res->booking_date." ";
$contents.=$answer." ";
$not_found++;
echo "<span style="color:green">".$object_res->emailaddress." Not Found In Database</span><br />";
}
else
{
$found++;
echo "<span style="color:red">".$object_res->emailaddress." Found In Database</span><br />";
}
}


$contents = strip_tags($contents); // remove html and php tags etc.
//header(Content-type: application/ms-excel);
//header("Content-Disposition: attachment; filename=both.xls");
//print $contents;
echo $found."Found<br />";
echo $not_found."Not Found<br />";
?>

Note that the above given PHP code is tried and tested.So you can use it straightaway.Just replace the Database Name, Username,Password and SELECT Queries (represented in BLUE color) as required.

Like this Stuff! Subscribe to our blog and we will email you working solutions of all common problems faced by a PHP Developer. 

Friday, May 13, 2016

PHP Download Scripts Two Free PHP Scripts Which Enable Users to Download Files from your Website

Today I am going to share two PHP Script which will be useful for all the Webmasters out there.This PHP Script will enable your visitors to Download various files (be it mp3,movies,zipped etc.) from your website.In short, this is a Download Script and its FREE!

1. Download Script 1

This Download Script works perfectly even when you need to download files from a Protected Directory.Besides this download script also uses Cache control which gives you an option to Open Files for Viewing Without Saving it on your Hard Drive.For example, in case of a text file, you can open the file to view its contents without saving the file on your Hard Disk.The Script is located below:
<?php

// place this code inside a php file and call it "download.php"
$path = $_SERVER[DOCUMENT_ROOT]."/path2file/"; // change the path to your websites document structure
$fullPath = $path.$_GET[download_file];

if ($fd = fopen ($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
switch ($ext) {
case "pdf":
header("Content-type: application/pdf"); // add here more headers for different extensions like doc excel and more
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use attachment to force a download
break;
default;
header("Content-type: application/octet-stream");
header("Content-Disposition: filename="".$path_parts["basename"].""");
}
header("Content-length: $fsize");
header("Cache-control: private"); //use this to open files directly
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose ($fd);
exit;
// example: place this kind of link into the document where the file download is offered:
// <a href="download.php?download_file=some_file.pdf">Download here!</a>
?>

It must be noted that in the above example ,emphasis is made on pdf files.But you can always add more headers to suit your needs.

2. Download Script 2

This PHP Download script will not show any Confirmation message when the download will complete.
<?php
session_start();
/*
Note that this PHP Script does not show Confirmation message when the Download Completes.You can make the
required changes to suit your needs
*/
//You Can Change the URLs to suit your needs
$error=http://errorexample.com;
$filepath=/my/local/file/path/to/images/;
$getfile = basename ($getfile);

if (isset($_POST[downl_file]) && basename($_POST[downl_file]) == $_POST[downl_file]) {
$getfile = $_POST[downl_file];
$_SESSION[downloadfile] = $_POST[downl_file];

} else {
header("Location: $error");
exit;
}
if ($getfile) {
$path = $filepath . $getfile;
// check that it exists and is readable
if (file_exists($path) && is_readable($path)) {
// fetch the file size and send the respective headers

$size = filesize($path);
header(Content-Type: application/octet-stream);
header(Content-Length: . $size);
header(Content-Disposition: attachment; filename= . $getfile);
header(Content-Transfer-Encoding: binary);
// opens in read only mode
// Ignore error message
$file = @ fopen($path, r);
if ($file) {
// stream the file and exit the script once download is completed
fpassthru($file);

exit;

} else {
header("Location: $error");

}
} else {
header("Location: $error");
}
}
?>
Note that these two PHP Scripts are WORKING!, so you can begin using it straightaway.If you have any suggestions regarding the script please feel free to share it with us.Feel free to edit the above two scripts to suit your personal needs.

Subscribe to our blog and we will email you similar interesting scripts as soon as it is published.

Enjoy!

Thursday, April 28, 2016

Plus Two SAY Improvement Results June 2015

The Results of the Second Year(Plus Two) Higher Secondary SAY/Improvement Examination, June 2015 is published.

The students who have complaints or doubts about their results can apply for Revaluation & Scrutiny for all subjects except Physics, Chemistry and Mathematics. They can apply for Photocopy of their answer scripts in respect of all subjects. The fee for Revaluation, Scrutiny and Photocopy are Rs. 500/-, Rs.100/- and Rs.300/- per subject respectively. The application should be submitted to the Principals of the schools where the candidates have registered for the examination.The last date for the submission of application is 15.07.2015. Click the below link for Plus Two SAY/Improvement Results 2014,Forms,Circular etc:-.
On completion of the revaluation process, changes if any will be intimated to the students through the portal and fresh certificates will be issued to them on production of the original certificates within the stipulated time.
SAY/Improvement Results  June 2015 Individual
Second Year (Plus Two) SAY/Improvement Result -Individual
SAY/Improvement Results June 2015 Schoolwise
Second Year (Plus Two) SAY/Improvement Result -Schoolwise
Higher Secondary Examination Forms & Circular
Application for Revaluation/Photocopy/Scruitiny
Plus Two SAY/IMP Result 2015.Circular dtd 07.07.2015


Sunday, April 17, 2016

Plus Two Chemistry Question Bank Chapterwise

Last updated on 16.12.2015: ???????????? ?????? ?????? ????????????????????? ???????? ????????? ?????????? ??????????????????. ???????????? ????????????????????? ????????????? ????????? ???????????? ???? ????????? ???????????? ??????.

2008 ???????? ?????? ???? 2015 ?? ?????? ???????? ?????? ??? ??? ??????????  ????????? ????????? (Chapterwise)  ????? ?????????????????.

??? ?????????? ????????? ??? ?????????? ????? ???????? ?????? ??????????????????, ?????? ?????   ??????? ??????????? ?????????????? ????????? ???????? ?????????? ???? ????????? ????????  ?????????? ??????????? ????????? ????????? ??. ???????????????? ???????? ????????? ???????? ???? ???? ????? ??. ?? (Anil Kumar K.L, HSST Chemistry, Govt Higher Secondary School, Thumbamon North, Pathanamthitta) ????????????? ????????? ??????????????.  ?????????? ????????? ??????? ?? ????????? ?????????????.

Plus Two (XII) Chemistry Previous Questions (Chapterwise)
Plus Two (XII) Chemistry Previous Questions (Chapterwise) 2008 to 2015
Plus Two (XII) Chemistry Question Bank by Hathim
Plus Two Chemistry Notes (Chapterwise)
Plus Two Chemistry Class Notes Prepared by Anil Kumar. K.L



Thursday, April 14, 2016

Plus One Plus Two Malayalam Notes

Last updated on 19.08.2015:  ??? ?????????? ?????? ?????? ??? ?????? ??? ??????????.

???????? ??????? ??? ?????????? ???????? ?????? ???????? ???? . ??????? ?????? , ??????????? ??????? ??? ?????????? ???????? ??. ?????? ?????????, ??????? ?? .??.?????.???.???  ?? ??.??.??????,  ????????????? ??????? ??????? ??? ?????????? ????? ???????? ???? ??.?? ,??????? ??????????? ??????? ?????????? ???????? ???????? ??.??., ???? ??.?? ?????????, ?????? ??????? ??? ?????????? ????? ?????????? ?.?? ??????? ?????  ?????????? ?? ????????????????????????. ?????????? ????????? ??????? ??? ???????????? ????????? ?????????????.

Class
Plus Two Malayalam Class Notes
XII ??????????? ??? ????????  
XII Plus Two Malayalam Class Notes-1
XII Plus Two Malayalam Text Book
XII Plus Two Malayalam Teacher Text
Class
Plus One Malayalam Class Notes
XI ?????? ?????????????? ???? ????????
XI ?? ?? ?????????  ??????? (??? ???????? -1 )
XI ?? ?? ?????????  ??????? (??? ???????? -2 )
XI ?? . ?? . ????????????? ??- ??????????? (??? ????????-1 )
XI ?? . ?? . ????????????? ??- ??????????? (??? ???????? -2)
XI ??????????
XI ????????? ????????? ????????
XI ????????
XI ???????? -?????????? ????????????
XI ?????? ?????????????(???????? ?????) 
XI Plus One Model Question Paper by SCERT 
XI Plus One Teacher Text by SCERT
Class
Plus Two Teacher Text
XII Plus Two Malayalam Teacher Text (Full Book)


Tuesday, April 12, 2016

Plus Two SAY Improvement Question Papers June 2015

Higher Secondary SAY / Improvement Examinations June 2015 Question Papers are available for download now.

Question papers of the Kerala Higher Secondary Plus Two SAY/Improvement Examinations conducted by the DHSE in June 2015.

Question Papers are available to download in PDF format and can be opened with Adobe Reader. You can print, download or copy text from all Question Papers.

HSE Plus Two SAY/IMP June 2015 Question Paper Download 
XII SAY/IMP June 2015-English
XII SAY/IMP June 2015-Malayalam
XII SAY/IMP June 2015-Physics
XII SAY/IMP June 2015-Chemistry
XII SAY/IMP June 2015-Computer Science
XII SAY/IMP June 2015-Computer Application (Commerce) 
XII SAY/IMP June 2015-Accountancy-Computerized Accounting  
XII SAY/IMP June 2015-Economics
XII SAY/IMP June 2015-Sociology
XII SAY/IMP June 2015-Biology
XII SAY/IMP June 2015-Mathematics(Science)
XII SAY/IMP June 2015-Political Science
XII SAY/IMP June 2015-Business Studies
XII SAY/IMP June 2015-History
XII SAY/IMP June 2015-Computer Application (Humanities)


Plus Two 2 New Text Books SCERT

Last updated on 30.06.2015: Computer Application(Commerce) Chapter 1 to 4 updated.

Text Books for the Kerala Higher Secondary Plus Two courses have been revised for the academic year 2015-16.

The new text books have been prepared by the Kerala State Council of Educational Research and Training (SCERT). Those who have not received the new course books can download the pdf versions available from this page for reference.

The Reference for the first & Second chapter available here till the text book distribution is completed. Click the below link and refer the new text book for HSE Second Year (Plus Two) for better comprehension.
Plus Two (XII) New SCERT Text Books for Kerala Higher Secondary
Malayalam
Malayalam(Optional)
English Literature Optional
English
Hindi
Hindi Optional
Tamil
Tamil(Optional)
Kannada
Kannada Optional
Anthropology
French
Arabic
Arabic Optional
Urdu
Urdu (Optional)
Islamic History
Sanskrit
Sanskrit Sahithya Optional
Sanskrit Sasthra Optional
Electronics
Computer Application (Humanities)
New: Computer Application Chapter 1-4 (Commerce)
Computer Science : Chapter 1 | Chapter 2 | Erratum
Geology
Journalism
Communicative English
Statistics
Russian
Latin
Syriac East
Syriac West
German
Home Science
Social Work
Gandhian Studies
Philosophy
Music
Wait for updates....
Plus Two (XII) New NCERT Text Books
Plus Two (XII) NCERT Text Books


Wednesday, April 6, 2016

Revaluation Result of Plus Two SAY IMP June 2015

The Revaluation / Scrutiny result of the Higher Secondary Second year (Plus Two) SAY/Improvement, June 2015 has been published.
Those students who have change of scores on revaluation shall submit their original scoring sheet along with a request to effect the change through the concerned Principal with in one month for effecting the change of marks.
Click the below link for Revaluation/ Scrutiny result of the Higher Secondary Second year(Plus Two) SAY/IMPROVEMENT June 2015.

Downloads 
Revaluation / Scrutiny Result of Higher Secondary Plus Two SAY/IMP June 2015

Sunday, March 27, 2016

Plus One Plus Two Mathematics Previous Questions 2006 2015

2006 ???????? ?????? ???? 2015 ?? ?????? ???????? ?????? ?????? ??? ??? ?????????? ???? ????????? (chapterwise) ????????? ???????? ????? ?????????????????. ??? ?????????? ???????????? ??????, ?????? ????? ??????? ??????????? ?????????????? ????????? ???????? ?????????? ???? ????????? ?????? ?????????? ????? ??? ????????????? ????????? ??????????????. ?????? ???????????? ??????? ????????????? ??????? ?????? ???????? ?????????????? ???? ????????? ??????????? ????????????????????? ????? ??????????????? ?????????? ???????????????? The Centre for Future Studies -??? ??????????? ????? ??? ??????????? ????? ??????? ??????????????? ???? ??????????????? ????????? ??????? ?????? ?????????? ?????????. ?????????? ????????? ??????? ????????????????????? ????????????? ????????? ???????????? ???? ?????????? ????????? ?????????????.
Downloads /XII Maths
XII Mathematics Question Bank (Chapter 1 to 3) 
XII Mathematics Question Bank will be updated on receipt..
Downloads /XI Maths
XI Mathematics Question Bank (Chapter 1 and 2) 
XI Mathematics Question Bank will be updated on receipt..
Related Downloads
XII Mathematics Study Materials
XI Mathematics Study Materials
XI Mathematics Revision Questions(Objective)

Thursday, March 24, 2016

Plus Two XII Mathematics Study Materials

Last updated on 08.01.16: ??? ?????????? ?????? ??? ?????????????? ?????????? ????? ??????????????. ?????? ???(????????) ???? ??????????????? ??? ???????????? ??????????? ????????????? ????????? ?????????????????????? ?????????? ???????????, ???????????, ??? ?????????? ?????? ??? ??????? ????? ???????????????????????.??? ???????????? ??? ???????? ?????????????? ???????? ??? ??????????? ?????????? ????????????????????. ????? ???????????????? ??????? ??????? ?? ????????? ???????????????.
?????? ??? ??? ?????????? ???????????? ???? ???????????? ?????????? ???????? ?????? ???????????????? ?????? ???????????? ??????? ????????????? ??????? ?????? ???????? ?????????????? ???? ????????? ??????????? ????????????????????? ????? ??????????????? ?????????? ???????????????? The Centre for Future Studies -??? ??????????? ????? ??? ????. ?????????????? ???????????????? ???????? ???????????? ??????? ?????????????????. ????????????????? ?????????????? ???????????? ??????????????? ?????????? ??????? ?????? ?????????? ?????????????????? "?????? ????????" ???? ????????? ????? ??? ??????? ???????????????.
Plus Two (XII) Mathematics Study Materials by Remesh Sir
XII Mathematics- An Introduction
XII Chapter 1 : Relations and Functions(Notes)
XII Chapter 1 : Relations and Functions-Assignment Questions
XII Chapter 2 : Inverse Trigonometric Functions(Notes)
XII Chapter 2 : Inverse Trigonometric Functions(Assignment)
XII Chapter 3 : Matrix Algebra(Notes)
XII Chapter 3 : Matrix Algebra-Assignment
XII Chapter 3 : Matrix Algebra-Questions for Unit Test
XII Chapter 3 : Matrix Algebra-Answer Key for Unit Test
XII Chapter 3 : Matrix Algebra-MCQ
XII Chapter 4 : Continuity(Notes)
XII Chapter 5 : Differentiability(Notes)
XII Chapter 5 : Differentiability(Assignment)
XII Mathematics First Terminal Exam-Model Question Paper
XII Chapter 6 : Applications of Derivatives
XII Chapter 7 : Indefinite Integral-Part I 
XII Chapter 7 : Indefinite Integral-Part II 
XII Chapter 8 : Definite Integral-Part I 
XII Chapter 9 : Differential Equations 
XII Objective Type(Multiple Choice) Questions
XII Mathematics Second Terminal (Christmas) Exam-Model Question Paper
XII Chapter 12 : Linear Programming
XII Mathematics Model Question Paper-1
XII Mathematics Model Question Paper by SCERT
Study materials will be updated on receipt...
Plus Two (XI) Mathematics Study Materials
XI Mathematics Model Question Paper



Wednesday, March 23, 2016

Plus Two XII History Study Notes

Last updated on 18.01.16: ??? ?????????? ?????? ??? ??????????????????? ????????? ??? ?????? ????? ??????????????. ?????? ???(????????) ?????? ???????????? ??? ??????????, ??????  ????????? ?????? ??? ??????? ????? ???????????????????????. ?????? ??? ??? ?????????? ???????????? ???? ???????????? ??? ???????????? ???????????? ???????? ?????? ???????????????? ???????? ?????? ??????? ??? ?????????? ????? ????????? ???????? ???? ???????? ??.
????????????? ??? ?????????? ?????? ?? ????????? ???????????? ??? ??????????? ?????????? ????????????????????. ????? ???????????????? ??????? ??????? ?? ????????? ???????????????.
XII History Study Notes-Downloads
XII (1-Notes).BRICKS, BEADS AND BONES (THE HARAPPAN CIVILIZATION)
XII (1-Questions).BRICKS, BEADS AND BONES (THE HARAPPAN CIVILIZATION)
XII (2-Notes).KINGS,FARMERS AND TOWNS
XII (3-Notes).KINSHIP,CAST and CLASS
XII (4-Notes).THINKERS BELIEFS AND BUILDINGS
XII (5-Notes).THROUGH THE EYES OF TRAVELERS
XII (6-Notes).Bhakti-Sufi Traditions
XII (7-Notes).An Imperial Capital
XII (8-Notes).Peasants, Zamindars and the State
XII (9-Notes).Kings and Chronicles
XII (10-Notes).Colonialism and countryside
XII (11-Notes).Rebels and the Raj
XII (12-Notes).Mahathma Gandhi and Nationalist Movement
XII History-Map Study-1
XII History-Map Study-2
XII History-Map Model Question
XII History Model Question by SCERT
Study materials will be updated on receipt...
XI History Study Notes-Downloads
Plus One (XI) History Study Notes and Model Questions

Plus One Plus Two XI XII Computer Science Notes

Last updated on 11.01.2016: Study Notes and Mock Test Tool of Plus one and Plus Two Computer Science , prepared by Anish Kumar published.

Expecting these materials,which have grown up to the status of support and guide, could be utilized by the learning and teaching community.

Study materials will be updated on receipt. Plus Two Computer Science Notes and Mock Test Tool can be downloaded from the following links.

Plus Two (XII) Computer Science Study Materials by Anish Kumar
Chapter 1- Structures and Pointers(Notes)
Chapter 1- Structures and Pointers(Mock Test Tool)
Chapter 2- Concept of Object Oriented Programming(Notes)
Chapter 2- Concept of Object Oriented Programming(Mock Test Tool)
Chapter 3- Data Structures and Operations(Notes)
Chapter 3- Data Structures and Operations(Mock Test Tool)
Chapter 4- Web Technology(Notes)
Chapter 4- Web Technology(Mock Test Tool)
Chapter 5- Web Designing Using HTML(Notes)
Chapter 6 -Client Side Scripting Using Java Script(Notes)
XII-Computer Science-Client Side Scripting Using Java Script-Notes Prepared by Bindu George,St.Ignatius HSS,Ernakulam(Chapter 6)
Chapter 7-Web Hosting(Notes)
Chapter 7-Web Hosting(Notes-Malayalam by Priya ,GHSS Purathur)
Chapter 7-Web Hosting(Power Point Presentation)
Chapter 8-Database Management System(Notes)
Chapter 9-Computer Application-SQL-Structured Query Language
Chapter 6 to 9-Computer Application-Chapter 6,7,8,9 by Anil Kumar
Chapter 10-Server Side Scripting Using PHP Notes 
Chapter 10-Server Side Scripting Using PHP- Power Point Presentation File by Bindu George
Chapter 11-Advances in Computing(Power Point Presentation) by Bindu George
Chapter 11-Advances in Computing(Power Point Presentation) by Pramod.C.Nair,HSST Computer Science,KKMHSS Vandithavalam, Palakkad
Chapter 12-ICT and Society Notes by Bindu George
Plus One/Plus Two Computer Application Notes
XI/XII Computer Application Notes for Commerce Students
Plus One (XI) Computer Science Study Materials by Anish Kumar
Chapter 1- The Discipline of Computing (Notes)
Chapter 3- Components of the Computer System(Notes by Kalish)
Computer Science Lab Work
Higher Secondary Computer Science Lab Work-Guidelines & Programs
Notes will be updated on receipt...


Tuesday, March 22, 2016

Plus Two Computer Notes Science Appl

????? ?????????? ??????? ???????? ??? ?????????? ???????? ??? ??????? ??? ???????????? ?????? ??? ??????????? ?????/???????????( ??????????)??? ???????????? ?????????? ?????? ???? ????????????????????. ???????? ????? / ?????????? ???????????? ?????? ??????????? ??? ?????????? ???????? ?????????? ???????????? ??? ?????? ?????? ???????????. ????? ???????????????? ??????? ??????? ??? ???????????? ??.?? ??? ???? ????????? ???????.


Lesson
Title
XII Plus Two Computer Science Class Notes
XII Plus Two Computer Application Class Notes (Humanities)
XII Plus Two Computer Science Presentation Slides