Advanced PHP Interview Question

Advanced PHP.
Q-command to fetch onlythe unique values?
A. select distinct column_name from table_name;Q. can a script come to a clear termination?
A using exit 0;Q. do i store binary in my sql?
A.Using BLOB data type columnQ.How do i limit the no of rows 1 get out of my database ?
A. select * from table_name limit n, m;

Q- How do i find out weather a no is odd or even ?
Here n and m defines the upper and lower limit for the selected rows;
if ($number%2== 0) then even else odd.

Q.Can I coonect to Ms-access database w/o a DSN?
A. To connect to MS Access, you may PHP’s ODBC functionality.

Q-How can we remove duplicate values from an array ?
A. array_unique funciton will return an array with unique (not duplicate) values.

Q. can we get the ID genrated from the previous insert operation ?
A. mysql_insert_id function will help you get the ID of lastly inserted record.

Q.What is the purpose of ob_start() ?
This function will turn output buffering on. While output buffering is ON no output is sent from the script (but headers), instead the output is stored in an internal buffer. to get contents from output buffer we can use ob_get_contents function

This function will redirect the output to a buffer. We can flush out the buffer ob_end_flush(). ob_start must be called before any output is made. so the apt place is immediately after opening the php tag.

How do you upload videos using PHP & MySQL
Whether Videos or Audios those are nothing but binary files. You may upload them using simple HTML forms (using enctype multipart/form-data) and may store they either in MySQL database BLOB type column (MySQL’s binary data type storing column) or you may store they in any directory (filesystem) on the serve