Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to retrieve from database..... this format (PRMRMDU402).
firstname= prabhu, lastname=kumar, city=madurai,
pincode=624402....

i want first name first two letters and last name last two
letters ... city first two letters ... pin code last three
letters....

Answers were Sorted based on User's Feedback



how to retrieve from database..... this format (PRMRMDU402). firstname= prabhu, lastname=kumar, cit..

Answer / gaurav

$record = mysql_fetch_array(".........");
$fn = substr($record['firstname'], 0, 2);
$ln = substr($record['lastname'], -2);
$ct = substr($record['city'], 0, 2);
$pc = substr($record['pincode'], -2);

$final = strtoupper($fn.$ln.$ct.$pc);

echo $final;

Is This Answer Correct ?    4 Yes 2 No

how to retrieve from database..... this format (PRMRMDU402). firstname= prabhu, lastname=kumar, cit..

Answer / ajit

SELECT SUBSTRING(`firstname`,1,2) as 'firstname',SUBSTRING
(`lastname`,-2) as 'lastname',SUBSTRING(`city`,1,2) as
'city',SUBSTRING(`pincode`,-3) as 'pincode' FROM
`user_info` WHERE 1

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

What is php crud api?

0 Answers  


How to get ip address of clients machine?

0 Answers  


Which is used to maintain the value of a variable over different pages?

0 Answers  


How can you compare objects in php?

0 Answers  


Tell me what type of operation is needed when passing values through a form or an url?

0 Answers  


What is the purpose of pear in php?

0 Answers  


How can we encrypt the username and password using PHP?

13 Answers   Avaria, HCL, TCS, Xpert,


at present am learning lamp course sir ..i want to know the carrer prospectus in php ...is there any companies recruiting freshers in chennai ..for freshers how much can i demand as a fresher in php ....?i finished my mca ..please sugggest me to face interview in php asking salary details and all please suggest me how much can i ask as a fresher in php ? and also tel is there any openings in chennai for recruting php freshers send their emails and company info please ? please send ur valuable suggestions to kiranpulsar2007@gmail.com i hope u wil reply to my question thank u guys bye take care see u soon all the best to everyone

1 Answers   Microsoft, Satyam,


How can php and javascript interact?

0 Answers  


What are the functions used in php?

0 Answers  


Why do we show php code in browser?

0 Answers  


Tell me how can we pass the variable through the navigation between the pages?

0 Answers  


Categories