Here i am putting some php and mysql questions for freshers
1. Difference between php4 & php5
2. Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
3. What is the difference between Split and Explode?
4. What is difference between mysql_connect and mysql_pconnect?
5. What Is a Persistent Cookie?
6. How would you initialize your strings with single quotes or double quotes?
8. What are new features that are in added in PHP5?
9. How To Write the FORM Tag Correctly for Uploading Files?
10. What is difference between require_once(), require(), include() and include_once()? Because above three function usefully use to call a file in another file.
11. What is difference between print, print_r, echo?
12. How can i get ip address?
13. What is the diffrence between Notify URL and Return URL?
14. What is difference between mysql_fetch_array(),mysql_fetch_row() and mysql_fetch_object() please insert with example?
15. How many types of method in php?
16. What is meant by urlencode and urldecode?
17. Which will execute faster on php POST or GET? Explain
18. What is the difference between mysql_fetch_object and mysql_fetch_array?
19. How can I execute a PHP script using command line?
20. What does a special set of tags do in PHP?
Some php questions with Answer
1. How can we submit a form without a submit button?
Ans - The main idea behind this is to use Java script submit() function in order to submit the form without explicitly clicking any submit button. You can attach the document.formname.submit() method to onclick, onchange events of different inputs and perform the form submission. you
can even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites).
2. How can we create a database using PHP and MySQL?
Ans - We can create MySQL database with the use of
mysql_create_db('Database Name')
3. What are the different tables present in MySQL, which type of table is generated when we are creating a table
Ans - Total 5 types of tables present in MySql
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
When we are creating any table with syntax
create table employee (eno int(2),ename varchar(10))
By default MyISAM is generated
4. How To Get the Uploaded File Information in the Receiving Script?
Ans - Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
$_FILES[$fieldName]['name'] – The Original file name on the browser system.
$_FILES[$fieldName]['type'] – The file type determined by the browser.
$_FILES[$fieldName]['size'] – The Number of bytes of the file content.
$_FILES[$fieldName]['tmp_name'] – The temporary filename of the file in which the uploaded file was stored on the server.
$_FILES[$fieldName]['error'] – The error code associated with this file upload.
5. WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP?
Ans - Three basic types of runtime errors in PHP:
1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although you can change this default behavior.
2. Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
3. Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.
Internally, these variations are represented by twelve different error types
If any one need question then reply me on risk.always@gmail.com
No comments:
Post a Comment