NotSureILikePHP Posted July 21, 2015 Share Posted July 21, 2015 I NEVER get a good answer here so I stopped posting and just post on PHP Phreaks but this is way too confusing so I have to try here. I can NOT for the life of me figure out what is going on with this code. It's so horribly coded and I'm new to php so it's like trying to learn Mandarin from a special needs kid.I created a class called Customers by mimicking the staff class. I can populate my grid with all the customers but when I try to search by a specific customer I have to know the full name WITH all the right capitalization. I'm trying to track down where the query is called but these coders don't use stored procedures they dynamically build them and it's one of the most complicated things I've ever seen. Here's the line of code I'm trying to trace, I think.... if ($filters) { $custs->filter($filters);}[/]Now I can find this function and when I echo what it returns it returns the querystring WHERE A1.`cust_name` = 'test' which is exactly what I am looking for. However, I can't trace it any further than that. This is the code in that function[code]foreach (func_get_args() as $Q) { $this->constraints[] = $Q instanceof Q ? $Q : new Q($Q);}[/]The Query looks likeSELECT A1.`cust_name` FROM `ost_customer` A1 WHERE A1.`cust_name` = 'test'I have spent HOURS searching this code for A1 (returns thousands of rows), SELECT (which returns even more rows around 4 thousand), CUST_TABLE which is the variable my customer table name is stored and I have found NOTHING.Can anyone help me find where this code is located so I can change it? I really wish they just used stored procedures. It would make this whole project so much more readable. I would also like to know how to add % to a textbox. For example, I have a textbox so that the user can type "Test" and it should return 1 customer in the database named "Testy Corporate" but it doesn't unless you type the whole name. I would like to add % to the beginning and end like "%test%". However, when you hit submit it posts back and runs the query. Now, I'm assuming if I ever find the place where the sql statement is called I should be able to change that but is there a way that when you hit submit it automatically appends that to the text? Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 21, 2015 Share Posted July 21, 2015 The easiest way to figure this out is to either find documentation on the system, or use XDebug + your favorite IDE and chase the rabbit. Quote Link to comment Share on other sites More sharing options...
NotSureILikePHP Posted July 22, 2015 Author Share Posted July 22, 2015 I do have Eclipse installed but I can't figure out how to chase the rabbit. I can get it to debug on certain pages but I have spent 30 minutes hitting step into and not gotten to the spot that I want because the code is so convoluted. It starts debugging right away and I have told it not to in the settings and when I hit play the first time it never hits another breakpoint. Is there a better debugger than Eclipse and XDebug or am I just doing something wrong? Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 22, 2015 Share Posted July 22, 2015 Not sure, it's been a long time since I've used Eclipse. I use PHPStorm + XDebug. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.