Monday, November 10, 2008

Question: What is the difference between mysql_fetch_object and mysql_fetch_array?

Question: What is the difference between mysql_fetch_object and mysql_fetch_array?
Answer:
MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array. mysql_fetch_object() is similar to mysql_fetch_array()‚ with one difference - an object is returned‚ instead of an array.
Indirectly‚ that means that you can only access the data by the field names‚ and not by their offsets.
MySQL_fetch_array() - Fetches a result row as an associative array‚numeric array.
MySQL_fetch_object() - Fetches a result row as an object.
MySQL_fetch_row() - Fetches a result set as a numeric array().

Question: How many ways we can retrieve the date in result set of mysql using php?

Question: How many ways we can retrieve the date in result set of mysql using php?
Answer:
- As individual objects.

- As a Single record.
- As a set or arrays.

Question: How can we submit from without a submit button?

Question: How can we submit from without a submit button?
Answer:
Trigger the JavaScript code on any event (like onselect of drop down list box‚ onfocus‚ etc) The javscript code to submit the form is: document.myform.submit();

Question: What are the differences between Get and post methods in form submitting?

Question: What are the differences between Get and post methods in form submitting?
Answer:
A. In the get method the data made available to the action page (where data is received) by the URL so data can be seen in the address bar. Not advisable if you are sending login info like password etc. In the post method the data will be available as data blocks and not as query string in case of get method.


The key difference between GET and POST is that POST has side-effects‚ and thus browsers will present a confirmation dialog to the user on refresh or "back".

Question: What is the difference between md5()‚ crc32() and sha1() crypto on PHP?

Question: What is the difference between md5()‚ crc32() and sha1() crypto on PHP?
Answer:
All these functions generate a hash code and the basic difference among them is the length of the generated hash. 1) crc32() - Generates the cyclic redundancy checksum polynomial of 32-bit lengths of the string. This is usually used to validate the integrity of data being transmitted. Generates 10-character hexadecimal number. 2) sha1() - Calculates the sha1 hash of a string using the "US Secure Hash Algorithm 1". Generates 40-character hexadecimal number. 3) md5() - Calculates the MD5 hash of a string using the "RSA Data Security‚ Inc. MD5 Message-Digest Algorithm" and returns that hash. Generates 32-character hexadecimal number.

Question: Who is the father of php?

Question: Who is the father of php?
Answer: Rasmus Lerdorf

Question: What is difference between PHP and HTML?

Question: What is difference between PHP and HTML? Answer:
HTML files are requested by browser‚ and returned by server. PHP files are requested by browser‚ and executed by the server to output a plain HTML that is returned to the browser.

What is PHP?

Question: What is PHP?
Answer: * PHP stands for PHP Hypertext Preprocessor.
* PHP scripts run inside Apache server or Microsoft IIS.
* PHP and Apache server are free.
* PHP is the most used server side scripting language.
* PHP files contain PHP scripts and HTML.
* PHP files have the extension “php”‚ “php3”‚ “php4”‚ or “phtml”.

security header validate

  HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)