Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By tom4213 on
Hi there,
I am trying to create a custom module to find a specific data within the website.
There are many stock tickers that end with ":US" in my database, but i do not what the ":US" after the ticker.
Example: The ticker "FB:US" will need to be "FB" - so I need to drop the ":US" from the ticker.
So some how i need to build a module to search the database for all of the tickers that end with ":US" and if the module does find one that ends in the ":US" then I only want the ":US" to be removed from the ticker.
Any ideas?
Thanks guys!
Comments
<?php$results = db_query(
$tickers will contain all of your values, stripped of the ':US' at the end of the ticker.