Jump to content

My query turns all "%" into "|"


DBookatay

Recommended Posts

I have a field in my dB that I use to store links from other websites, (Kelly Blue Book / kbb.com) to be exact, which uses links like this:

 

http://www.kbb.com/KBB/UsedCars/PricingReport.aspx?VehicleId=3110&ManufacturerId=34&ModelId=227&YearId=2004&Mileage=54210&SelectionHistory=3110%7c6222%7c06810%7c0%7c0%7c120944%7ctrue%7c120968%7ctrue%7c120857%7ctrue

 

Problem is, when I pull the info out of the dB

$kbbSlctn = $row['kbbSlctn'];

it turns all of the "%" into "|", so the result is

http://www.kbb.com/KBB/UsedCars/PricingReport.aspx?VehicleId=3110&ManufacturerId=34&ModelId=227&YearId=2004&Mileage=54210&SelectionHistory=3110|7c6222|7c06810|7c0|7c0|7c120944|7ctrue|7c120968|7ctrue|7c120857|7ctrue

 

What is happening here?

Link to comment
https://forums.phpfreaks.com/topic/78158-my-query-turns-all-into/
Share on other sites

Its decoding the url use this on it to turn it back into a link

<?php
$link = urlencode('http://www.kbb.com/KBB/UsedCars/PricingReport.aspx?VehicleId=3110&ManufacturerId=34&ModelId=227&YearId=2004&Mileage=54210&SelectionHistory=3110%7c6222%7c06810%7c0%7c0%7c120944%7ctrue%7c120968%7ctrue%7c120857%7ctrue');
?>

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.