Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. You need to make a separate page that your Ajax requests. This page should then only return the data that you want. A better option though when working with Ajax is to return Json (which can be easily handled by Javascript as an object).
  2. mod_php is the preferred method of using php with Apache. FastCGI is allot slower because it needs to actually startup a new process on each request.
  3. You do need to make sure they have been selected in your query.
  4. You haven't showed us where $info is defined.
  5. See the problem? That is always going to return an entire page. test.php should only return the data you want. I think your missing a big part of what Ajax is and how it works. Generally, you use it to return fragments of a page.
  6. Variables are not interpolated in single quoted strings. <?php $var = 'map.swf'; echo ' <OBJECT ID="map" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,0" WIDTH="50%" HEIGHT="50%"> <PARAM NAME="Movie" VALUE=" $var "> <PARAM NAME="Play" VALUE="false"> <PARAM NAME="Quality" VALUE="best"> <PARAM NAME="swLiveConnect" VALUE="true"> <PARAM NAME="loop" VALUE="false"> <EMBED NAME="slav" SRC="' . $var . '" swLiveConnect="true" WIDTH="50%" HEIGHT="50%" mayscript="mayscript" quality="best" play="false" LOOP="false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash2"> </EMBED> </OBJECT>'; ?>
  7. $conn = mysql_connect(); $db = new Database($conn); Not unless your using php5.4 (which isn't stable yet).
  8. Use absolute paths from $_SERVER['DOCUMENT_ROOT'].
  9. Yes. Make the connection first and pass it into your object upon instantiation. Your querying for two different users so not really. As I said, a "Person" represents a single "person".
  10. I would seriously consider removing the singleton from this class. Singletons are renowned for making your code tightly coupled which should be avoided where possible. As for your question, I'm not sure I understand the issue. Your "person" model should represent a single row in your database, if you want "persons" you should create another model for that. This "persons" model or collection would then return an array or "person" objects.
  11. This is a terrible way of storing your data in the first place. You should look into "database normalisation".
  12. Most of us are self taught. Anyway, eval can be very dangerous as it can open a hole where a user might be able to execute arbitrary code.
  13. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=353285.0
  14. I'm a massive fan of Jira buit it get's pretty expensive pretty quickly and needs a decent server to run well. There really aren't many good PHP solutions around. Lot's of Ruby, Python or Java though.
  15. $.post("test.php", {"locationID": post_id}, function (txt) { $('#single-home-container').text(txt); });
  16. Yes it makes a difference, even if your not writing to a log file. Then you don't code well. Fix your code.
  17. Both styles are valid SQL and will work in MySQL.
  18. eval is almost always the wrong tool. $return call_user_func_array(array($this->formsObj, $methodName));
  19. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=353216.0
  20. array_diff will provide you with a solution.
  21. lock is a reserved word in mysql. Either change your column name or surround it with `backticks`.
  22. Cool. We can't help you without seeing relevant code.
  23. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=353224.0
×
×
  • 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.