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....

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Define object-oriented methodology?

568


How can you pass a variable by reference?

554


How can we determine whether a variable is set?

520


How to return ascii value of character in php?

587


Why is php used?

562






What is php string function?

526


Is php pass by reference or value?

533


What is the difference between htmlentities and htmlspecialchars in php?

475


in PHP for pdf which library used?

553


What are the benefits of using php and mysql?

507


Tell me what should we do to be able to export data into an excel file?

518


What is the difference between html and php?

539


Tell me what is the difference between unset() and unlink()?

532


What is the difference between abstract class and interface in php?

520


Which function is used in php to count the total number of rows returned by any query?

515