Jump to content

Recommended Posts

Posted

Can someone help me create a trigger for a database?

 

The front end GUI where the person will be sending data can not be set to send in all caps, so I am trying to do it on the back end.

 

Is this possible with MYSQL?

 

Thanks,

Adam

Posted (edited)

You say the data could be coming from anywhere, but surely you have a query at some point to add the data into the db?

 

So in your insert query do something like this:

 

>$query = ' INSERT INTO tbl_name (fld_name) VALUES(\''.strtoupper($the_value).'\')';

 

i.e. convert the string to uppercase as you insert it into the db

 

 

or is this not what you want?

 

 

if you want to write an update query it will be something like:

 

>UPDATE tbl_name SET fld_name = UPPER(fld_name) WHERE fld_name = 'blahblah'

Edited by OJB

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...