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 |
Explain the difference between mysql_connect and mysql_pconnect?
How can I display text with a php script?
What is super keyword in php?
What is empty php?
What is the meaning of a persistent cookie?
If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b? Can anyone explain how's the value of $$b=100
15 Answers ABC, Asan, Indivar, Swistro Marketing Solutions,
Explain about Type Juggling in PHP?
What is a php class?
Can you pass an array into a function?
What is the difference between md5(), crc32() and sha1() crypto on php?
Is php easy language to learn?
What is baseurl?