mduke [Dreamweaver Talk]Strip leading zeros in search results using DW Advanced Search code
Feb 23, 2009; 08:32
mduke
[Dreamweaver Talk]Strip leading zeros in search results using DW Advanced Search code
I'm using a DW extension, advanced search, to query a MySQL table, and I'm having trouble figuring out how to strip leading zeros from the returns of a column of (mostly) numbers. The column, "grade," is varchar format because includes "k" and numbers (i.e., k, 01, 02, 03, etc.).
There is ample documentation on how to do this using PHP (using "ltrim") but I can't figure out how to incorporate it into Advanced Search. I tried to create a new variable to capture "grade" returns, but lack the knowledge to get this to work (which is why I use the PHP/MySQL extensions in the first place).
I added the zeros in the first because, otherwise, when searching for "1" or "2" I get returns of "1, 11, 12" or "2, 12", respectively. The client understandably doesn't want to see "01, 02, ...", however.
Since I only want to affect the display, I would think there'd be a way to modify the following body PHP snippet:
<p><?php echo $row_RecordSet1['grade']; ?> </p>
I am certainly open to an alternative approach, but I'm somewhat committed to using the Advanced Search extension if at all possible.
If you need to see more code, let me know.
Marcus Duke Webmaster/Information Specialist UW Aquatic & Fishery Sciences
-- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Dreamweaver/Browse/ Manage your subscription: http://www.ListSearch.com/Dreamweaver/
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!