This category contains PHP Interview Questions and Answers
How To Create a Table?
PHP Interview Questions And Answers
Bookmark
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces.
What are the different tables present in MySQL? Which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10))?
Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
MyISAM is the default storage engine as of MySQL 3.23. When you fire the above create query MySQL will create a MyISAM table.
How To Create a Table?
If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script:
Remember that mysql_query() returns TRUE/FALSE on CREATE statements. If you run this script, you will get something like this:
Table Tech_links created.
How can we encrypt the username and password using PHP?
Answer1
You can encrypt a password with the following Mysql>SET PASSWORD=PASSWORD("Password");
Answer2
You can use the MySQL PASSWORD() function to encrypt username and password. For example,
INSERT into user (password, ...) VALUES (PASSWORD($password”)), ...);
How do you pass a variable by value?
Just like in C++, put an ampersand in front of it, like $a = &$b
What is the functionality of the functions STRSTR() and STRISTR()?
string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive.
stristr() is idential to strstr() except that it is case insensitive.
When are you supposed to use endif to end the conditional statement?
When the original if was followed by : and then the code block without braces.
How can we send mail using JavaScript?
No. There is no way to send emails directly using JavaScript.
But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example:
function myfunction(form)
{
tdata=document.myform.tbox1.value;
location="mailto:
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
?subject=...";
return true;
}
What is the functionality of the function strstr and stristr?
strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr("
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
","@") will return "@example.com".
stristr() is idential to strstr() except that it is case insensitive.
Page Numbers : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Have a Question ? post your questions here. It will be answered as soon as possible.
Check Interview Questions for more Interview Questions and answers
Be first to comment this article
Only registered users can write comments. Please login or register.