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
    Interactive shell
    
    php > $text = 'nogdog';
    php > $initialCap = strtoupper($text[0]);
    php > echo $initialCap;
    N
    

    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))
      
        Write a Reply...