cutepraba Posted April 22, 2012 Share Posted April 22, 2012 $name = $name . "<option value=". $row['name'] . ">" .$row['name'] . "</option>"; but the name is "Mr. Robert",it does have dot symbol...how to overcome? please help Link to comment https://forums.phpfreaks.com/topic/261397-my-result-having-dothow-to-get-the-values/ Share on other sites More sharing options...
cpd Posted April 22, 2012 Share Posted April 22, 2012 Just because your value has a dot it doesn't mean PHP will treat it as the concatenation symbol. It treats the value as, most likely, a string and the dot is part of that string... Link to comment https://forums.phpfreaks.com/topic/261397-my-result-having-dothow-to-get-the-values/#findComment-1339491 Share on other sites More sharing options...
Barand Posted April 22, 2012 Share Posted April 22, 2012 The problem is the space, not the dot. Enclose the value in single quotes. $name = $name . "<option value='". $row['name'] . "'>" .$row['name'] . "</option>"; Link to comment https://forums.phpfreaks.com/topic/261397-my-result-having-dothow-to-get-the-values/#findComment-1339514 Share on other sites More sharing options...
cpd Posted April 22, 2012 Share Posted April 22, 2012 Aw my bad, the lack of explanation threw me. Moreover you can do: $var = "Hello"; $var.= " World"; echo $var; // Hello World Link to comment https://forums.phpfreaks.com/topic/261397-my-result-having-dothow-to-get-the-values/#findComment-1339522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.