Jump to content

Value help PLEASE!!


M.O.S. Studios

Recommended Posts

Hey guys I’m hoping that one of you can help.

 

Here is my problem, I'm using a mysql database with php and have a snag, I have a value is placed from a form into the database and has another value added in front of it in the same field. Like this "<?php $a = $b . " - " . $a; ?> ", that works great the first time, however the next time I edit that value the value becomes " $b . " - " .$b . " - " . $a; " and so on and so on. Is their any way I can I can have the value check first and remove the first " $b . " - " . " if its already their?

 

 

To give an example this is what structure to is.

 

        Form data entered

Then

        Form data placed for variation (all needed values added)

Then

        Values add to database with  value $b .“ – “. Add in front of them

 

 

To give an example this is what I would want the structure to be.

       

        Form data entered

Then

        Form data placed for variation (all needed values added)

Then

        Values are check i the $b.“ – “. value is placed infront

                If yes {$b.“ – “. value is removed from infront Then}

Then

        Values add to database with value $b.“ – “. Add in front of them 

 

 

Any help is good help

 

THANKS GUYS!

 

Link to comment
https://forums.phpfreaks.com/topic/114438-value-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.