I have a PHP file in which I want to convert the user input into uppercase letter , so I used strtoupper() function of PHP but it is not working.Here is my code
$eno =@$_SESSION['eno'];
$eno =strtoupper($eno);
Now on inserting this into database , it is still in lowercase letters.Here is the insert query.
$sql="INSERT INTO `student_info`(`student_no`,`High_School_Name`, `Year_Of_Passing`, `Higher_Secondary_School_Name`, `Year_Of_Passing1`, `Enrollment_Number`, `Roll_Number`, `Current_Course`, `Current_Sem`, `Current_section`, `Enrollment_Year`, `Alternate_Email`)VALUES('$studentno','$High_School_Name','$Year_Of_Passing10','$Higher_Secondary_School_Name','$Year_Of_Passing12','$eno','$Roll_Number','$Current_Course','$Current_Sem','$Current_section','$Enrollment_Year','$Alternate_Email' )";
$eno='vikram';
echo $eno =strtoupper($eno);
$sql="INSERT INTO `student_info`(`student_no`,`High_School_Name`, `Year_Of_Passing`, `Higher_Secondary_School_Name`, `Year_Of_Passing1`, `Enrollment_Number`, `Roll_Number`, `Current_Course`, `Current_Sem`, `Current_section`, `Enrollment_Year`, `Alternate_Email`)VALUES('".$studentno."','".$High_School_Name."','".$Year_Of_Passing10."','".$Higher_Secondary_School_Name."','".$Year_Of_Passing12."',ucase('".$eno."'),'".$Roll_Number."','".$Current_Course."','".$Current_Sem."','".$Current_section."','".$Enrollment_Year."','".$Alternate_Email."' )";
use this function in query: select UCASE ('vikram')
There is no problem
echo $eno;
.. and look at the results.