Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:10:56+00:00 2026-05-28T03:10:56+00:00

I need some help cutting out a line from a path that’s returned from

  • 0

I need some help cutting out a line from a path that’s returned from my database.

The results of “ImagePath” in the database return /share/images/Gif/XXX/XXXXXX/ (XX being filler for whatever is actually returned)

I need to cut off “/share/images/” from the results of ImagePath so I would just get /Gif/XXX/XXXXXX/

The reason is that this instance of the database is one way > updated from another server that has a different location for the images so I don’t really want to go through and delete those lines from the database since the next time it’s updated it would revert to the other path I just want to cut out those lines from the results.

<?php

        define('INCLUDE_CHECK',1);
        require "connect.php";
        require_once("class.php");

        mb_internal_encoding("UTF-8");

         // $product_id = intval($_GET['product']); //no default
            $UPC = intval($_GET['upc']); //no default


        $result = mysql_query("SELECT ImagePath, AlphaName, brand_name, FullName, ingredients FROM Images, Products WHERE ImageType='gif' AND images.ProductID = products.ProductID AND ViewCode='CF' AND products.UPC = '$UPC'");
        $count=mysql_affected_rows();

        $objJSON=new mysql2json(); 
        print(trim($objJSON->getJSON($result,$count)));


            /* disconnect from the db */
            @mysql_close($link);

        ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:10:57+00:00Added an answer on May 28, 2026 at 3:10 am

    Well you can always do substring:

    select substring(imagepath, 14) as ImagePath...
    

    Or replace, if your ImagePath values aren’t all the same:

    select replace(imagepath, '/share/images/', '') as ImagePath...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help assigning a mouseover event to display some icons that start out
I need some help from the shell-script gurus out there. I have a .txt
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some help in creating function which can create folders recursively with giving path:
Need some help, I have a regular expression that appears to work just fine
Need some help: I want to only pull back the results for a specific
Need some help joining these two tables I have two views that looks like
I need some help from some linux gurus. I am working on a webapp
need some help! I'm trying to write some code in objective-c that requires part-of-speech

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.