Question : How can we get the browser properties using PHP?
Answer : By using
$_SERVER[’HTTP_USER_AGENT’] variable.
Question : What is the maximum size of a file that can be uploaded using PHP
and how can we change this?
Answer : By default the maximum size is 2MB. and we can change the following setup at php.iniupload_max_filesize = 2M
Question : How can we increase the execution time of a PHP script?
Answer : by changing the following setup at php.inimax_execution_time = 30; Maximum execution time of each script, in seconds
Question : How can we take a backup of a MySQL table and how can we restore it. ?
Answer : To backup: BACKUP TABLE tbl_name[,tbl_name…] TO ‘/path/to/backup/directory’
RESTORE TABLE tbl_name[,tbl_name…] FROM ‘/path/to/backup/directory’mysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table. -t, –no-create-info Don’t write table creation information (the CREATE TABLE statement). -d, –no-data Don’t write any row information for the table. This is very useful if you just want to get a dump of the structure for a table!
Question : How can we optimize or increase the speed of a MySQL select query?
Answer : • First of all instead of using select * from table1, use select column1, column2, column3.. from table1
•Look for the opportunity to introduce index in the table you arequerying.
•use limit keyword if you are looking for any specific number of rows from the result set.
Question : How many ways can we get the value of current session id?
Answer : How many ways can we get the value of current session id? session_id() returns the session id for the current session.
Question : How can we destroy the session, how can we unset the variable of a session?
Answer : session_unregister — Unregister a global variable from the current session
session_unset — Free all session variables
Question : How can we destroy the cookie?
Answer : Set the cookie in past.
Question : How many ways we can pass the variable through the navigation between the pages?
Answer : •GET/QueryString
•POST
Question : What is the difference between ereg_replace() and eregi_replace()?
Answer : eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.
No comments:
Post a Comment