Science Forums
User Name
Password
Science Social Network
home    members    help/rules    who is online    contact   

Go Back   Science Forums > Physical Sciences Forums > Computer Science
Become a science forums sponsor today
Reply
 
LinkBack Thread Tools
Old 04-04-2008   #1 (permalink)
InfiniteNow's Avatar
Suspended


 



In a PHP based url, can a search term use a wildcard?

I've got a report function in our local training system, where we enter the manager ID of a group, then the course code. This will pull who in that managers group has completed that course code and who has not.

I'm trying to find a way to replace putting a (or multiple) specific course code (or codes) with a "begins with" logic that will pull all course codes beginning with a certain term.

However, I've messed around a bit with wildcards (like * and %), but either the wildcards don't work, or my syntax is wrong.



An example of an actual report url for a specific manager and a specific course is as follows:

http: //OurTrainingSite/reports/mgr_drill_multi.php?mgrid=IDgoesHere&QS_crse_codes =ExactCourseCode


What I want is a way to do something similar, but with "QS_crse_codes" begins with "CodePrefix."

Any ideas of syntax to try?



If I can't get it to work this way, I'll just ask our DEV team to create a new report type with this logic, but my hope is that I can leverage existing functionality without the need for a production change request. My skills are limited, and this may not even be possible, but I figured it could not hurt to ask.

Any and all ideas are welcome. Cheers.
Reply With Quote
Old 04-04-2008   #2 (permalink)
InfiniteNow's Avatar
Suspended


 



Yeah... Never mind

Ah... bugger. Prolly not gonna be able to do unless it's arlready programmed in or I get access to the code itself.
Reply With Quote
Old 04-05-2008   #3 (permalink)
Tormod's Avatar
Hypographer

Hypography Staff Member
Administrator
Senior Editor
Editor
Dev Team Member

 



Re: Yeah... Never mind

Wouldn't this be done on SQL level with something like

$coursecode = $_GET['QS_crse_codes'];

SELECT bla bla
FROM blabla
WHERE tblQS_crse_codes LIKE "$coursecode%";


----------------
Your Friendly Neighborhood Administrator

Want to sponsor Hypography? Buy a print in our Fall 2008 Benefit Sale

Join our Facebook group or follow us on Twitter

Science is not only compatible with spirituality; it is a profound source of spirituality.
- Carl Sagan
Reply With Quote
Old 04-07-2008   #4 (permalink)
alexander's Avatar
Resident USSRian

Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member

Latest blog entry:
Open-Source HIDS
 
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
 



Re: Yeah... Never mind

no, T, i think that is what he is trying to avoid doing.

Infy, it's all in how the search function is implemented, if it's looking for an exact value, and the code is written appropriately, then no matter what you try to do, you will not be able to search for a wild string. As T said, it's in the sql statement, if it says "like" then any search is going to be wild stringed, but if it says = then you can use speciffic wild string symbols. The problem is that a good developer will put a decent checking system in place to prevent people from making arbitraty strings for use with SQL injection, so all of the special database symbols will be replaced or backslashed, so you can't do the magic sql injection deed...

i would suggest getting the code and implementing it in there, in some sort of way (would depend on what is currently being done)


----------------
And remember that great question that Pierre-Simon Laplace and Sir Isaac Newton, Andrei Markov and David Hilbert, Richard Feynman and Enrico Fermi, Albert Einstein and Edmund Halley did not come to ask throughout all of their dedication and work: "Who the hell is IMing me?"


This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Old 04-07-2008   #5 (permalink)
InfiniteNow's Avatar
Suspended


 



Re: In a PHP based url, can a search term use a wildcard?

Yeah, that's correct. We will need to leave the existing report as is. What I will have done is to create another report, very parallel to the existing, but with "begins with string" logic instead of "equals exact code" logic. Then, I can publish that new report on the same end user page as the existing report so both are available.

Thanks again guys. I had a feeling that this was not something I could do with existing code, but you've definitely made me more comfortable that it won't be hard to make happen.


Cheers.
Reply With Quote
Old 04-07-2008   #6 (permalink)
Tormod's Avatar
Hypographer

Hypography Staff Member
Administrator
Senior Editor
Editor
Dev Team Member

 



Re: In a PHP based url, can a search term use a wildcard?

Ah, I see. Well! Something to wrap my brain around.


----------------
Your Friendly Neighborhood Administrator

Want to sponsor Hypography? Buy a print in our Fall 2008 Benefit Sale

Join our Facebook group or follow us on Twitter

Science is not only compatible with spirituality; it is a profound source of spirituality.
- Carl Sagan
Reply With Quote
Reply

Bookmarks

Tags
search, url, wildcard


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Short term and long term memory. converting and such. Theory5 Psychology 0 10-15-2007 12:30 PM
Non Carbon based life Moontanman Biology 19 05-02-2007 02:41 AM
Long Term Space Enviroment. KickAssClown Space 21 10-17-2006 07:30 AM
Realism: Evolution-Based coberst Philosophy and Humanities 4 09-16-2006 02:19 AM
Long term information storage FrankM Computer Science 11 12-08-2004 10:31 AM


All times are GMT -8. The time now is 01:17 PM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. Copyright © 2000-2008 Hypography
Part of the Hypography - Science for Everyone Network