Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. $sqllens = mysql_query("SELECT AND SHOW COLUMNS FROM `members` WHERE field='Lens' AND username LIKE '$username'");
  2. This line.... var instance = new foo('hello'); Creates an instance of the 'foo' object called 'instance'. this line.... instance.bar(); then calls the bar() method of that object.
  3. Indeed it does. You should get a pop-ups saying 'hello'. I forgot it only works with objects literals. That's those instantiated using the 'new' keyword.
  4. How should we know? Maybe you have overridden there normal functionality with css? Without seeing though, we would only be guessing.
  5. Actually, I'm thinking now that the 'prototype' property is only available on native objects.
  6. The problem is you where passing $result2 to mysql_fetch_assoc without first checking to make sure your query succeeded. mysql_fetch_assoc expects a result resource, which is what mysql_query returns if it succeeds, but when it fails it returns false. While your at it, you should likely check your query returns some records as well. $query2 = sprintf("SELECT * FROM (c_details INNER JOIN c_color ON c_details.cc_id = c_color.cc_id) WHERE c_color.cc_id = %s", mysql_real_escape_string($colour)); if ($result2 = mysql_query($query2)) { if (mysql_num_rows($result2)) { $print2 = mysql_fetch_assoc($result2); } else { // no records found. } } else { // query failed }
  7. Firstly, objects (in any language) are used to describe 'things' of a specific 'type'. So making one generic 'thing' object and setting a 'type' property isn't likely to be a good design. If these 'things' share attributes however you could have your objects inherit from a 'base' object which defined all the common attributes. Next, objects don't persist by themselves. So, if your going to be storing there data within a database, just query the database for the data you need. No need to make objects that your not going to use.
  8. That error message indicates that whatever you are passing to mysql_fetch_assoc on line 90 is not a result resource.
  9. Take a look at the user examples for the substr function.
  10. Your trying to send a file to a browser that is part html (text) and part image. You need to treat the first script you have as an image. therefor, your second piece of code should look like.... <html> <body> <img src="firstscript.php" /> </body> </html> Make sense?
  11. I could, in one script create an object and give it some properties. var foo = { a: 'blah' } I could then later add a method to the object... foo.prototype.bar = function() { alert(this.a); } Its a method of inheritance.
  12. Why? This wreaks of poor design. You should look into database normalization techniques.
  13. This is pretty much the basics of what php is used for. Creating dynamic pages from data stored within a database. You don't actually create a physical page for each clip. There's some sort of example I wrote here : http://www.phpfreaks.com/forums/index.php/topic,227131.msg1048650.html#msg1048650 Though the net would have literally thousands of examples of this if your searched.
  14. You can use include to include content from one file to another.
  15. On this line.... $url = /'http://www.yourdomain.com/accountok.php\'; // Where to redirect The very first / does not belong there. Your also escaping the closing ' Then, all these lines.... $user = $_POST[\'username\'];//get username from form Why are you escaping the single quotes? Don't. Generally, if your editor starts highlighting things incorrectly it means your code is incorrect. As is the case here.
  16. Can you post your actual code? Looks to me like your escaping stuff unnecessarily.
  17. $locked is an array, try elseif($locked['locked'] == 1).
  18. Looks like you have version incompatibility issues. How was php and its modules installed?
  19. I think the load() method would actually require a complete url so as to have the server execute the php.
  20. Shouldn't make any difference. You could however, instead, use mod_rewrite to change the extension within a url to xml.
  21. You have the word Linux in your name yet have not heard of Diff?
  22. If they are all on the same network then they will come from the public facing gateway's ip address. Not possible.
  23. Learn some Javascript and post your efforts. We are not here to write code for people too lazy to learn.
  24. This board is for help with existing code, not help finding it.
×
×
  • 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.