In how many ways we can retrieve the date in the result set of mysql using PHP?
Ans
we can do 4 ways
we can do 4 ways
1 mysql_fetch_row
2 mysql_fetch_array
3 mysql_fetch_object
4 mysql_fetch_assoc
2 mysql_fetch_array
3 mysql_fetch_object
4 mysql_fetch_assoc
What is the difference between $message and $$message?
$message is simple variable
$$message is reference variable
$$message is reference variable
How can we create a database using PHP and mysql?
We can create MySQL database with the use of mysql_create_db($databaseName) to create a database.
Q:-How can we know the count/number of elements of an array?
Ans:
count(arrayname);
Ans:
count(arrayname);
what is a meaning of
Q:How can we create a database using PHP and mysql?
A:
In the earlier versions of PHP we were using
mysql_create_db($dbstring,$link) to create a databse,but PHP5 n latest versions of PHP do not support this function.
Now we will have to use
mysql_query(”create database databasename”); to create database.
mysql_drop_db($dbname,$link) is also not supported by PHP5 n onwards versions.
A:
In the earlier versions of PHP we were using
mysql_create_db($dbstring,$link) to create a databse,but PHP5 n latest versions of PHP do not support this function.
Now we will have to use
mysql_query(”create database databasename”); to create database.
mysql_drop_db($dbname,$link) is also not supported by PHP5 n onwards versions.
Q:How can we know the count/number of elements of an array?
A:
A:
//returns 4
count() function returns the no of elements of its argument.
It returns 1 for scalar variables.
count() function returns the no of elements of its argument.
It returns 1 for scalar variables.
//returns 1
Q;Who was the father of PHP?
A; “Rasmus Lerdorf” was the father of PHP. He introduced php in 1995.
Q:What are the different functions in sorting an array?A; “Rasmus Lerdorf” was the father of PHP. He introduced php in 1995.
A: The functions for sorting array are following:
1- sort($array)- is used for enumerated array(numeric array)
sorts the array element in asending order.
2- rsort($array)- is used for enumerated array,sorts the array element in decending order.
3- asort($array)- is used for associative array,sorts the array value in asending order.
4- arsort($array)- is used for associative array,sorts the array value in decending order.
5- ksort($array)- is used for associative array,sorts the array keys in asending order.
6- krsort($array)- is used for associative array,sorts the array keys in decending order


0 comments:
Post a Comment
Hardware
Thousands of Prequalified Suppliers Trade Leads, Products & Companies
www.Alibaba.com