-
Posts
840 -
Joined
-
Last visited
-
Days Won
1
Everything posted by gristoi
-
Where to place DB calls during refactoring
gristoi replied to dennis-fedco's topic in PHP Coding Help
you could follow the mvc pattern, or have a look at how symfony 2 deals with it by using repositories. -
Display other data based on dropdown selection
gristoi replied to JayPawar's topic in PHP Coding Help
you may want to look at using jquery and ajax to achieve what you want -
you have 4 choices: 1. develop native app in android. - learn android 2. develop native app in IOS - learn objective c 3. develop web based app to deploy to stores ( i.e sencha touch ) - learn javascript 4. make a responsive website - learn web design and css / js
-
I agree with Ch0cu3r. You need to write this out, and then ask for help. Not just get someone else to do the work. Whats the point if you don't learn anything? And if the person / site giving you the task to do is asking you to use globals then i would seriously look elsewhere as this is a severly outdated methodolgy
-
the forum is to help people who have problems with their code. if you want someone to do the work for you then you need to expect to pay them. if so post in the freelance section
- 1 reply
-
- addclass
- removeclass
-
(and 3 more)
Tagged with:
-
How to add a drop down for a navigation bar in php
gristoi replied to tobba03's topic in Third Party Scripts
you need to contact the developer of the third party script and ask them directly how to integrate this -
put user in backticks too
-
turn on your error checking
-
store the data in the db before making the request to paypal , but set a flag to say payment not received
-
have a google on passing by value and passing by reference
-
if you are asking for someone to do all the work for you then you need to post this in the freelance section.
-
amazing tool google you know: http://redmine.lighttpd.net/boards/2/topics/5465
-
no, there is no limit. I have json arrays with 100k + results. You are looking at the wrong thing. you need to see what your calendar is doing with the json results. and please be more clearer on excatly what is not working
-
what do you mean by "it writes out the actual words?"
-
MYSQL, query WHERE variable = result from different query
gristoi replied to eternal_noob's topic in MySQL Help
nested select or join: nested select: SELECT DISTINCT SysproCompanyJ.dbo.InvMaster.Description, SysproCompanyJ.dbo.InvMaster.LongDesc FROM SysproCompanyJ.dbo.InvMaster WHERE SysproCompanyJ.dbo.InvMaster.StockCode LIKE '%(SELECT substring(invW.StockCode, 1, (len(invW.StockCode) - 1)) as sStockCode, SUM(invW.QtyOnHand - invW.QtyAllocated) FROM SysproCompanyJ.dbo.InvWarehouse as invW WHERE Warehouse = 'SW' GROUP BY substring(invW.StockCode, 1, (len(invW.StockCode) - 1)) HAVING SUM(invW.QtyOnHand - invW.QtyAllocated) > 0)%' -
DATE_SUB(checkin_date,INTERVAL 2 DAY)
-
yep, no mysql_query()
-
Dynamic change of page title from AJAX called page
gristoi replied to gamesmstr's topic in Javascript Help
Firstly it is 2014 you should have no need to build raw ( and outdated ) ajax calls like this. Consider switching to a modern JQuery method for your ajax calls -
databases are relational, so use them. You have duplication that you need to normalise. Part number and descirption could be moved into a parts table. then you could have an orders table. so would look like: // parts table id | part_number | part_description 1 ABC Switch //orders table: id | part_id | Qty | Cost | OEM_Resale 1 1 1 1.00 3.5 2 1 25 1.00 2.75
-
remember aswell using an inner join means records need to be in table on both sides, or no resuts
-
you have no need to use a sub select: SELECT t1.*, p.* FROM detail t1 INNER JOIN posts p USING(content_id)
-
sorry, didn't see the multidimensional comment: usort($arr, function($a, $b) { $a1 = $a["username"]; $b1 = $b["username"]; $out = strcasecmp($a1,$b1); if($out == 0){ return 0;} if($out > 0){ return 1;} if($out < 0){ return -1;} });
-
think of extensibility in this. Sure, for now it is good in one file and you can 'see' all the code in one file. If connivence is your worry then that is what IDE's are for. Using one such as PHPStorm lets you search for code in hundreds of files in a matter of seconds, Links between class method names and adds support for helping you write good clean code. you need to take into consideration: What happens if the lines(brand) expand? will you maintain a single file with 4,5 6.....100 different product lines? What happens if you are asked to start producing the outputs in XML, or RSS? In procedural your code will end up getting messier and more fragmented. But dalecosp is right. Unless you want to learn OOP, or the code is not going to grow, then stick with procedural. Personally, when i moved into OOP many moons ago i have never looked back. t is very rare that i use anything but oop ( but there are occasions when i just need a procedural script)