Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Google "Apache + SSL".
  2. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=336103.0
  3. Interfaces - A class that implements an interface must implement all of the public (which is an implicit method declaration) methods from the interface. It's basically a generic template for any class that implements it. You can add additional functions if you wish. Example - *Note* this was for work so it's in Java, but it was recent and you should get the idea. We have indexes from electronic books that are transformed into either palmindexes or sqliteindexes. The common theme here is that they are both indexes and will always use generic 'index methods'. public interface Index { /* * @return the number of entries in this index */ public int getSize(); /* * @return the position in this index of the first entry that starts with entry and -1 if it is not found */ public int findEntry(String entry); /* * fill a list with the indexenries that startwith or match the entry up to a max of max for sql indexs this will be looked for in the entire database not just this index */ //vector public int findEntries(Hashtable results, String entry, int max); . . . //blah blah blah, a bunch more methods } Now I have two more classes named PalmIndex.java and SQLiteIndex.java that both implement Index. public class PalmIndex implements Index { // Constructors public int getSize() { // TODO: Auto-generated method stub } public int findEntry(String entry) { // TODO: Auto-generated method stub } public int findEntries(Hashtable results, String entry, int max) { // TODO: Auto-generated method stub } } public class SQLiteIndex implements Index { // Constructors public int newMethod() { // Additional method that I need for sqlite, you can add as many as you want } public int getSize() { // TODO: Auto-generated method stub } public int findEntry(String entry) { // TODO: Auto-generated method stub } public int findEntries(Hashtable results, String entry, int max) { // TODO: Auto-generated method stub } } That way, when I got to decide which one to use, I can just create an instance of the Index interface. You can make different and multiple constructors if you wish (that's why the PalmIndex instance has more parameters). This would be used as so: public static Index blahMethod(String catname) { Index index = null; if (SearchView.inDB(catcode)) { index = new SQLiteIndex(path, Integer.parseInt(catcode)); } else { index = new PalmIndex(resDB, catname, Integer.parseInt(catcode), indexnum); } return index; } Interfaces are very important in Java because the language does not support Multiple Inheritence (I don't think PHP does either) so you can extend multiple Abstract classes and implement a single interface to circumvent this caveat, if you will. Again, sorry it's in Java, I can easily port it to PHP if you want. I'll write up an Abstract post a little later as well.
  4. If you're going to have spaces in your column names (which is bad practice) then you have to surround them with backtics `.
  5. In the future, please place tags around your code.
  6. Not if you spell it like this @practise.
  7. First off, none of the variable are interpolating because you have them literally as HTML. When you're using PHP variables in HTML, you need to put them in tags or echo the HTML out, i.e. 1) { echo "Previous"; } ?> Fix all of those first.
  8. What exactly is the problem?
  9. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=335867.0
  10. Maq

    Android

    If you're offering a freelance project I can move it to that section.
  11. I don't think you understand what exactly is going on. In layman's terms, PHP ultimately generates HTML and serves it to your browser and then the validator checks against that.
  12. What's your table structure? You would do something similar to: "SELECT * FROM tweets WHERE twitter_id='$twitter_id' ORDER BY date DESC LIMIT 1";
  13. What I meant is that "database.php" is included in another file and the function 'tep_db_num_rows' is called there. You need to find where this is being called because it is the query that's probably failing.
  14. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=335701.0
  15. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=335677.0
  16. Either do a search for "tep_db_num_rows" or if you're using an IDE like Eclipse you can double click on the function and hit ctr+shift+g and it will show you everywhere the function is called.
  17. Since we can't see where the "tep_db_num_rows()" function is called, we don't know how the query for the $db_query result set is constructed. Show us where you're calling "tep_db_num_rows", or better yet, where the actual query string is being formed. My guess is that the query is failing, giving mysql_num_rows an invalid parameter type.
  18. In the future, please place tags around your code.
  19. Where is the redirect code?
  20. This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=335682.0
  21. Not sure what you're getting at, it's a framework. I won't hold my breath... Let's just say this, even if all browsers complied to a universal standard I would still use JQuery. Besides a very gentle learning curve, I don't know of any downsides.
  22. In regards to your first issue, we need to see some more code. Your second issue: that's the $value => $key. The key should correlate to the table name.
  23. Sure, if you're still having trouble with the tutorial/script just come back and ask. You can mark threads resolved (bottom right button, I believe).
  24. I don't know why, the foreach should exhaust after it traverses all the table columns. Are you sure it's not errorring out? *NOTE: The variable names changed from your original code to mine. There is an underscore separating the letters & numbers, which are the array keys. Try putting error reporting on an echoing out the values to see where it stops (if it does): ini_set ("display_errors", "1"); error_reporting(E_ALL); $query = exec_mysql_query("SELECT * FROM sources WHERE cat_id = '$cid' AND id = '$id' LIMIT 1"); $row = mysql_fetch_assoc($query); foreach($row as $value => $key) { $$key = $value; echo "$key => $value "; } ?>
  25. Did you read reply#1? (rhetorical)
×
×
  • 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.