# SQL extract part of string

**URL:** <https://forum.kirupa.com/t/sql-extract-part-of-string/245129>\
**Category:** programming\
**Created:** [November 26, 2007, 6:47pm UTC](https://forum.kirupa.com/t/sql-extract-part-of-string/245129 "2007-11-26T18:47:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pucca](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pucca](https://forum.kirupa.com/u/pucca)\
**Post date:** [November 26, 2007, 6:47pm UTC](https://forum.kirupa.com/t/sql-extract-part-of-string/245129/1 "2007-11-26T18:47:55Z")

</div>

hi. got an image on a db site (php, mysql), . When you click on the image, I want it to open the bigger image… the image in the database is called, i.e. THUMB\_H\_087\_image5\_JUO.jpg. that displays correctly. now… I want to open the bigger one, that’s called H\_087\_image5\_JUO.jpg. (without the THUMB\_)… it’s NOT saved in a field in the DB… but it’s saved on the server.

How do I call mysql so that it will exlcude the “THUMB\_” from the string…

pheww. this is difficult to explain… here’s my code for the image:

```auto
    
<a href="http://www.iwondata.net/RSA/HNBS/WhiteBoard/image_display/<?php echo $rowsres['webid']; ?>/<?php echo $rowsres['image2']; ?>" target="_blank" ><img src="http://www.iwondata.net/RSA/HNBS/WhiteBoard/image_display/<?php echo $rowsres['webid']; ?>/<?php echo $rowsres['image2']; ?>" border="0" width="150" alt="Open Image" /></a>

```

So… you see… the code in the a href’s

```auto
<?php echo $rowsres['image2']; ?>

```

needs NOT to have the THUMB\_ (but image2 in the DB HAS got it…

Pls let me know if SOMEBODY understands what I’m trying to get here…

much appreciated.
