Jump to content

andygrant

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andygrant's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I have created a PHP site but have noticed the pages seem to be running a bit slow. I heard a way to find bottlenecks is to Profile your code, however I am using a shared server and don't have access to the php.ini file so I think this stops me from using Xdebug that many sites recommend. Therefore I was wondering if anyone knew good ways to Profile code that doesn't require access to php.ini. Thanks
  2. My classes aren't particulally complicated but I guess the OOP technique I used issues more SELECT statements than before. Basically all my classes are created using an id, then they do a SELECT using that id and loop through the fields populating each variable in the object. If a classes extends another class they each do SELECTS as well, rather than if I did a single SELECT accross multiple tables at once the old way. So if I did a search for 'news items' it would get the id's for each news item and create each news object using the id, and each object would do a SELECT to get the full details. I'm not sure how else to do it really, does this sound like a poor technique?
  3. Hi I have just built my 1st php site using objects but it seems to be much slower than usual sites I've built. I've used __autoload to load classes, and foreach a lot more as opposed to while loops are these things slow? Or could it just be thats its using a lot more memory by holding arrays of objects compared to just records of mysql results. I found it better to code with OOP but if its going to be slower I'm not sure I can continue this way. Any ideas will be apprieciated. Thanks
  4. SELECT * FROM tblClients, tblPersonalDetails WHERE personalLink = 'client' AND personalLinkID = clientID The statement I'm running is above, as you can see it is pretty simple so I don't see how there could be an error in in. Basically it just links two tables together, if I do a LIMIT it works better. There will only be one tblPersonalDetails record to match each tblClients record.
  5. I have a problem on a webpage that is doing a SELECT across two tables. The tables have approx 4000 records each and return approx 4000 records, each table only has fewer than 10 fields. It is a simple SELECT statement linking the two tables so the statement isn’t wrong and it runs fine using some MySQL software. But the problem is that when I try to run the statement from a PHP webpage it seems to time out. It doesn’t give any PHP error it just gives says ‘Internet Explorer cannot display the webpage’ as if the webpage doesn’t exist. I have increased the ‘memory_limit’ and ‘max_execution_time’ and also tried ‘set_time_limit(0)’ but they didn’t have any affect. Does anyone have any idea what could be causing this to not load? Does this sound like PHP/MySQL is timing out? Thanks
  6. Hi I was wondering if anyone knew if it was possible to access all variable that are instances of a specific type of object. So if I had a user class and created a few of these through the code could I get access to all later without keeping track in some way as they are created. Thanks in advance
  7. I'm having a problem with a couple of pages that won't load when I perform a certain MySQL SELECT. When trying to open these pages in Internet Explorer it shows page not found and in Firefox a popup prompt is shown asking if I want to open the page in Dreamweaver or save the file. The pages are getting data from 4 linked tables, the details of the tables are below. The search should return 4,677 results and it works fine if the tables are smaller or if there are extra parameters to limit the amount of results. The database has 28 tables and is only 1.7Mb total size so there aren't loads of columns in each table. The data is borken onto pages so not all the data is being shown to the screen so the actual pages that should output is quite small. table1, 4,677 rows, 262.8kb table2, 7,506 rows, 536.0kb table3, 2,815 rows, 117.9kb table4, 4,677 rows, 110.1kb Could something be timing out, is there a limit to the size of the data that can be returned? Although I wouldn't expect a large size of data is really being returned. Any help will be appreciated. Many Thanks
  8. Can anyone help? Has anyone else been shown page cannot be displayed when doing searches on large tables? Most of the data isnt being output either. Thanks
  9. Hi I'm executing a MySQL query and its getting data from two linked tables that have around 4500 and 7500 rows. My query should return about 4500 results but it seems to be timing out. When loading the page in IE it just gives a page cannot be found and Firefox shows a Popup asking if i want to open the file in Dreamweaver or save the file. If i alter the quert slightly so it only returns 200-300 results it works fine. The results are actually seperated onto 25 per page but it still wont work. Even when only select COUNT(*) it doesn't work. Is there a limit to the amount of results that can be returned. Looking in phpMyAdmin the size of the tables are 250-300kb in size. Thanks in advance.
  10. Hi I have a function to create objects dynamically and I have seen you can use variables for the new xxx part, however the objects I'm creating require different amounts of paramaters sent to them on creation. I attempted to do this by sending the class name and an array of the parameters, then using implode to split the parameters array by a comma and it sort of creates what I wanted, but its only being recognised as one string paramter rather than multiple comma seperated parameters. new $objectName(implode(', ', $parameters)); The code I tried is shown above, does anyone have an idea how I could best achive this. I could probably do it putting the entire line into an eval() but I'd rather avoid this if someone has a better idea. Many Thanks
  11. Hi I have this same issue and was wondering if someone could give me some advice on multiple extends, my situation is below: Class A: Finished object that doesn't extend anything Class B: Finished object that doesn't extend anything Class C: Not developed but needs to inherit everything from A and B Normally I have things extend A or B but I now need a new object to extend both, therefore I was wondering is that possible to achieve this without altering A and/or B so that one of them extends the other before I can create C? Ideally I would like to keep A and B unchanged as they are standard objects I use for various things but I haven't needed them together before. Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.