hello i want to insert value and also put first letter capital into the the table like this ....
--------Below rough sketch of my table--student
id firstname start_with
1 daniyal D
2 loreen L
3 eainaa E
how to use insert query to put data from input of "firstname"
One way would be to use a combination of strtoupper() and substr(). An alternative is to use the fact that you can treat a PHP string as a array of characters:
$ /usr/bin/php -a
php > $text = 'nogdog';
php > $initialCap = strtoupper($text);
php > echo $initialCap;
NogDog i want add first letter capital by using query ,,, how to use
Do you mean some sort of update query to add it to existing records?
In MySQL, I think you could do:
UPDATE student SET start_with = UPPER(SUBSTR(firstname, 1, 1))
This smells a bit like an XY Problem. Just saying.