You should be tested for food allergies like gluten and dairy.
You didn't say what medication the doctor prescribed or what he said his diagnosis was. You need to take charge of your condition so you don't waste time trying the same things.
Not every treatment will help everybody, but you will need to be persistent and give treatments a little time to kick into gear. Some strong laxatives are not good to take all the time.
Safe ones you can try are: Magnesium citrate tablets. Metamucil. This comes in tablets or a powder. Either way you need to take enough water. You would work up to a dose of 5 or 6 pills a day if you use the pills.
If Metamucil is not enough, you could try MiraLax (or a generic of this). Do this when you will be home or have a bathroom nearby, because this may or may not give quick results for you.
Stop eating fried food, empty sugar calories (like soda), and unhealthy carbs. Eat lean meats/poultry/fish that is not fried. Eat lots of vegetables that are colorful. Eat whole fruit rather than juice. Limit starchy foods.
If these do not help you after a couple of weeks, then have a colonoscopy and/or barium enema to find out what's going on.
Remember that laxatives are habit forming. The muscle that is in the lining of the intestines which cause the waste to move down to the colon for the bowl movement can stop working well enough for the natural process to happen. I sometimes go 2 time a day and have been normal for many years, though I've heard normal for some people can be up to 2 days without a movement. Myself I don't believe that's healthy, but I'm only a lay person with a lot of experience with several issues. What you eat matters, enough water matters very much and not using things that will shut down the automatic process of the body matters. You might check out some things that are natural that will help your intestines get back their normal tone. I know this may not help much but did what to write what I was sensing when reading your question. Blessings.....
I have experienced constipation for 12 years now and have only just come to the realisation that it is and always has been directly related to my emotional state. If I am experiencing negative emotions, (like depression, stress, etc.) then I am constipated. You need to try to dissasociate from the negative thought pattern you have now developed in relation to going to the toilet. You need to find a way of relaxing (like meditating) that will help you to go to the toilet. You also need to find a natural laxative and make sure your laxatives don't have phenalalamine in them (this is a very harmful sweetener that is found in Metamucil and with prolonged use can highly increase your risk of cancer). I have recently come across a natural alternative called "Burdock". It is a plant root that you make into a tea and is very good for you. Health and organic stores may stock it.
My husband uses Metamusil. Now he says you can't tell it's in the OJ but I don't know if that would work for me. My son has the same problems and a specialist told use to put him on fiber. He takes "gummy drops" full of fiber and this has helped him so much. They are an all natural that we bought at Walmart $10.00). This was not an overnight fix but it was much better after a few weeks and then got him regulated. Goodluck!