1. What is the difference between mysql_fetch_object and mysql_fetch_array?
ans:
mysql_fetch_object() is similar to mysql_fetch_array(), but returns an object instead of an array.i.e. mysql_fetch_object() fetches the first single matching record.
where as mysql_fetch_array() will fetch all matching records from the table in an array.
2. What is the major difference between $_GET and $_POST in php?
ans: $_GET - information sent from a form is visible to every one.
$_POST - information sent from a form is NOT visible to every one, and also there is no limit on the information send.
3. Which function is used for the redirection in PHP?
ans: header()
4. How to retrive a value from MySQL database using php?
ans:
-> $con = mysql_connect("host","username","password");
-> mysql_select_db("db1", $con);
-> $result = mysql_query("query",$con);
-> $row = mysql_fetch_array($result);
5. What is the difference between Primary Key and Unique key?
ans:
Primary key - A colomn in a table, whose value uniquely identifies the rows in the table. Only one primary key for a table and it can not be null.
Unique key - Used to uniquely identify each row in the table. There can be more than one unique keys for a table and it can be null also.
6. What are the advantages of MySQL and PHP?
ans: Both of them are open source and support cross platform. Php is faster than ASP or JSP.
7. How can we submit a form without a submit button?
ans: document.formname.submit();
ans:
mysql_fetch_object() is similar to mysql_fetch_array(), but returns an object instead of an array.i.e. mysql_fetch_object() fetches the first single matching record.
where as mysql_fetch_array() will fetch all matching records from the table in an array.
2. What is the major difference between $_GET and $_POST in php?
ans: $_GET - information sent from a form is visible to every one.
$_POST - information sent from a form is NOT visible to every one, and also there is no limit on the information send.
3. Which function is used for the redirection in PHP?
ans: header()
4. How to retrive a value from MySQL database using php?
ans:
-> $con = mysql_connect("host","username","password");
-> mysql_select_db("db1", $con);
-> $result = mysql_query("query",$con);
-> $row = mysql_fetch_array($result);
5. What is the difference between Primary Key and Unique key?
ans:
Primary key - A colomn in a table, whose value uniquely identifies the rows in the table. Only one primary key for a table and it can not be null.
Unique key - Used to uniquely identify each row in the table. There can be more than one unique keys for a table and it can be null also.
6. What are the advantages of MySQL and PHP?
ans: Both of them are open source and support cross platform. Php is faster than ASP or JSP.
7. How can we submit a form without a submit button?
ans: document.formname.submit();
No comments:
Post a Comment