Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Routing and Database Mapping
    text
    copied!<p>Here is some background on the problem. </p> <p>We have a database of vehicles. The data is purchased from a third party and imported. Some columns in the database have symbols in their values (Trade mark, Copyright etc...)</p> <p>example</p> <p>Kawasaki Ninja &amp;reg &tm;.</p> <p>We have a Controller which handles the displaying the vehicles from a database but one of the parameters from the route is used as a criteria in pulling data from the database.</p> <p>So we will have routes that look like this</p> <p>/Kawasaki/Ninja</p> <p>which will display all Kawasaki Ninja bikes. There is a single action in the controller which takes the values from the route Kawasaki and Ninja and generates a SQL statement to pull all Kawasaki Ninjas from the database. Here is where the problem is the data in the database is not always going to be clean like I stated above it will have different symbols. </p> <p>Is there a elegant solution to this where I can easily look up data in my database by using the Route that zend provides me. Having the special characters in the URL isn't a valid solution according to the business rules so that has been ruled out. We have also looked into cleaning the data in the database and removing any unwanted symbols. That however would require changes to the way data is imported or having a script run through the database and do cleaning. We would like to be able to leave the data in tact and avoid any type of wild card searches against the database. This mapping needs to be able to be done both ways from the database to url and the url to database</p> <p>Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload