Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
MySQLand HTML

Posted by goangus (goangus), 8 November 2007
Hello there,
I have a small problem with a select query.  I have a table with product names that contain ampersands.  To comply with W3C I have entered these all into the table as '&'. This works perfectly except for one thing; if I do a Select query "WHERE prod_name like '%".$_REQUEST['q']."%' and the q variable is an "a", obviousy the query picks up on the a in "&" which in turn causes all sorts of javascript errors because of the semicolon.  Is there a way of saying Select where prod_name like something but only if the something is not in an html character??  
Sorry if this is unnecessarily complicated...
Thanks

Paul

Posted by admin (Graham Ellis), 8 November 2007
Paul, I would suggest that you store the data in its real form in the MySQL database and translate it as necessary before you display it on the screen.  From a computing viewpoint your data is arteficial and unclean if you store it coded in the database, and it gives rise to problems like the one you describe; go the way I've suggested and your search and javascript issues are automatically resolved.

Posted by goangus (goangus), 9 November 2007
Very true, I didnt event think of translating it before display!!! So simple, sometimes you cant see the wood for the trees, as they say.

Thanks Graham



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho