Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. CACHE CACHE CACHE... If you have content dragged from a database that is not going to change that often then cache the page - next time someone requests that page all you need to do is show the cached page instead of hitting the database once more.
  2. you have SET it! isset will check to see if the given argument is set. if ((bool)$testObj->testVar === false) is more like what you are after.
  3. ermmm I think you are missing something there fella. the conditional will evaluate to a true or flase. your statments is saying... if 5 OR 0 OR (5/0 [which will give a warning]) is true... this conditional will ALWAYS return true so you will always get big echoed out
  4. Hey people, I have apache 2.2.11 and php 5.3 installed on my dev machine - manual installation so no xamp and what not. I have downloaded the latest eclipse pdt and need a bit of help configuring it to work with my setup. Firstly I would really appreciate any guidance on installing/configuring zend debugger and xdebug - they are 'bundled' with eclipse but obviously I want to run the server I have installed already so when I test I get the error message that the debugger has not been installed as an ini directive... Secondly I run virtual hosts so I have each site I work on the server and access them via www.sitename.dev. in the directory structure I have public_html AND application in the root - so as not to expose all of my application code. I want to set up similar in eclipse but when I got to test it states its publishing to ww.sitename.dev/project/public_html i'd like eclipse to publish all the files to coreesponding folders in the site directory and not treat the workspace root as the site root. Any help would be VERY much appreciated.
  5. if you are paginating your results then you need to run two queries - 1 to get the count of all the rows that meet criteria and 2 to get a set of results (10 rows). its fine to run these queries in the next call to the page (just altering which range of rows to return) - not limiting the number of rows will mean your query takes A LOT longer to run and use MORE resource to complete
  6. no - but you could pre populate the file field and see if that works.
  7. why can't you apply limit on your search? http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html that document states you can...
  8. all apologies - I didn't see the comment in the line code... - my bad. ngreenwood picked up the missing brace on the if...
  9. php has nothing to do with loading the swf - php simple generates the markup that tells the browser to load it. If the swf is large then it will take a little time to load - in which case I would have a look at using a progress bar in your flash. you could pre-load the file using javascript on another page of your site that the users would normally visit before hitting this page but otherwise you are stuck with the bandwidth available to the visitor.
  10. Parse error: syntax error, unexpected T_STRING in /home/a7502957/public_html/members.php on line 158 It would be great if you could highlight the line of code the parser is telling you to check. It may well be the actual issue is before this line so if you could show the code in members.php (as much as possible) so that we can see line 158 and what code relates to it.
  11. its not that no one will help you - we have done so already. If the parser is giving you an error then you need to be able to understand that information and act on it - that is something that you need to be able to do your self. If you do't understand terms like 'markup' then you should really go and do a little more self teaching as that is fundamental. People want to help - but we don't have the time to teach everything - you need to take some of that on yourself.
  12. perhaps if you hi-lighted the relevant portion of code it would help us identify the issue?
  13. find line 236 in your code. it could be a closing php tag or html tag on that line or in a line above it.. TIP for you - break out of php for outputting markup - you have to go through all that html as well as your code to detect the error.
  14. difficult to be more specific when you have been given the answer. adsense is javascript - all you need to do at the desired point in your markup (the corresponding point in you php code that is) is to echo out the code google have given you to display their 'work'
  15. table as a, table as b - please replace the 'table' with what ever your table is called. - just checked your code and it appears to be called 'users'
  16. NOT the best solution in the world but quick and nasty... <?php header('Content-Type: text/xml; charset=UTF-8'); // Load and Start IPB SDK require_once "ipbsdk/ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); global $ibforums; echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <gt> <s><![CDATA[' . $_GET['s'] . ']]></s> </gt>'; mysql_query("UPDATE ibf_members SET s = '". mysql_real_escape_string($_GET["s"]) ."' WHERE id='{$ibforums->member["id"]}'"); ?>
  17. SELECT a.* FROM table as a, table as b WHERE a.username = b.username and a.id != b.id try that
  18. are you saying that when you go to /forums/rofl.php?&s=hey you want to parse that xml and replace the 2 with what ever $_GET['s'] is then print that out?
  19. Sorry but you have not explained what you want to achieve. Nobody is going to read through your code (php OR javascript) to decipher what you are trying to communicate. EXPLAIN in such a manner that no one will have to ask you a question in order to understand your problem.
  20. That's a ruddy good questuin - how do you want to use that code in your rolf.php?
  21. http://www.phpfreaks.com/forums/index.php/topic,268350.msg1265888.html read through that thread. the issue of updating rather than inserting is still handled by the same method of enforcing unique values in the database.
  22. sort does NOT return an array - it returns true or false... <?php sort($votecounter); $smallcount=1; foreach ($votecounter as $c){ $sql="INSERT IF NOT EXISTS INTO supersum$casenum (field, votes) VALUES ($c,1)"; if ($mysqli->query($sql)===true){ }else{ die("could not insert vote into supersum" . $mysqli->error); } if ($c==$foreachcounter){ $smallcount++; $sql="UPDATE supersum$casenum votes='$smallcount'";; if ($mysqli->query($sql)===true){ }else{ die("could not insert vote into supersum" . $mysqli->error); } }else{ $smallcount=1; } $foreachcount=$c; } ?>
  23. If you use __autoload this is not an issue. storing an object in a session means the object gets auto-magically serialized and un-serialized - you can also control that using the __sleep and __wake methods within the class itself.
  24. REMEMBER - your configuration settings will more likely need to available in the global scope. For this reason I include a file with a series of define() statements. If you must create an array then you will need to ensure it is available in every function or class - defining constants automatically makes these available globally.
  25. personally I create a configuration file that defines a number of constants. constants are addressed more efficiently than variables, they exist in the global scope and cannot be changed at runtime. OR you could use parse_ini_file and create your custom configuration in there - the scope of the array returned is not global or so I believe.
×
×
  • 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.