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
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 |
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 |
What is the phpstorm?
Do you know what is the use of rand() in php?
How does header() work . What do they tell the server same question for SESSIONS
Explain about the connective abilities of the PHP?
What is the use of session and cookies in php?
What difference between require() and require_once()?
What are the special characters you need to escape in single-quoted stings?
How can you declare the array in php?
I went to an php interview yesterday.I got selected there.But,They asked me to sign bond by submitting my certificates for 2 years.Is it good or bad
How can you compare objects in php?
What does pear stand for?
Tell me what are sql injections, how do you prevent them and what are the best practices?