Crew-Portal Posted August 25, 2007 Share Posted August 25, 2007 How would I go about making all the text in a field go to uppercase before it goes into the MySQL. I know where to inseert the code I just dont know what the code is? Can someone help a poor pathetic N00bi3 Quote Link to comment https://forums.phpfreaks.com/topic/66617-solved-make-uppercase/ Share on other sites More sharing options...
vijayfreaks Posted August 25, 2007 Share Posted August 25, 2007 Hi.. you can use: SELECT UPPER('Hej'); will result in HEJ -vijay Quote Link to comment https://forums.phpfreaks.com/topic/66617-solved-make-uppercase/#findComment-333753 Share on other sites More sharing options...
Crew-Portal Posted August 25, 2007 Author Share Posted August 25, 2007 so I can make it <?php SELECT UPPER($_POST['uppercasetext']); ?> Quote Link to comment https://forums.phpfreaks.com/topic/66617-solved-make-uppercase/#findComment-333756 Share on other sites More sharing options...
Crew-Portal Posted August 25, 2007 Author Share Posted August 25, 2007 No I finally found it on PHP.net! TOPIC SOLVED!!! <?php $str = "Mary Had A Little Lamb and She LOVED It So"; $str = strtoupper($str); echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO ?> Quote Link to comment https://forums.phpfreaks.com/topic/66617-solved-make-uppercase/#findComment-333758 Share on other sites More sharing options...
beboo002 Posted August 25, 2007 Share Posted August 25, 2007 there is some thin wrong use this select UPPER(columnname) from table name where columnname=$_POST['uppercasetext']; insted of SELECT UPPER($_POST['uppercasetext']); Quote Link to comment https://forums.phpfreaks.com/topic/66617-solved-make-uppercase/#findComment-333759 Share on other sites More sharing options...
vijayfreaks Posted August 25, 2007 Share Posted August 25, 2007 no.. if you want it in php then its simple: strtoupper ( string "string" ) use:$up=strtoupper('qwe'); // $up contains QWE and if you you want it in executing query then for that you can use this qry:SELECT UPPER('Hej'); but b4 that <?php $link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password') or die('Could not connect: ' . mysql_error()); echo 'Connected successfully'; mysql_select_db('my_database') or die('Could not select database'); // Performing SQL query $query = "SELECT UPPER('Hej') as up"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); echo mysql_result($result, 1); ?> -vijay Quote Link to comment https://forums.phpfreaks.com/topic/66617-solved-make-uppercase/#findComment-333760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.