trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
$sqllens = mysql_query("SELECT AND SHOW COLUMNS FROM `members` WHERE field='Lens' AND username LIKE '$username'");
-
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.
-
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.
-
How should we know? Maybe you have overridden there normal functionality with css? Without seeing though, we would only be guessing.
-
Actually, I'm thinking now that the 'prototype' property is only available on native objects.
-
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 }
-
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.
-
That error message indicates that whatever you are passing to mysql_fetch_assoc on line 90 is not a result resource.
-
Take a look at the user examples for the substr function.
-
Difficulties in displaying resized images using imagecopyresampled
trq replied to programming.name's topic in PHP Coding Help
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? -
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.
-
How to enter each post together in one field for the database via form?
trq replied to djfox's topic in PHP Coding Help
Why? This wreaks of poor design. You should look into database normalization techniques. -
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.
-
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.
-
Can you post your actual code? Looks to me like your escaping stuff unnecessarily.
-
$locked is an array, try elseif($locked['locked'] == 1).
-
RedHat 5.5 PHP Version 5.2.10 can't load php-mssql and php-pdo
trq replied to akvino's topic in Microsoft SQL - MSSQL
Looks like you have version incompatibility issues. How was php and its modules installed? -
jQuery - After adding to the database display new record via div/Ajax
trq replied to suttercain's topic in Javascript Help
I think the load() method would actually require a complete url so as to have the server execute the php. -
Shouldn't make any difference. You could however, instead, use mod_rewrite to change the extension within a url to xml.
-
You have the word Linux in your name yet have not heard of Diff?
-
If they are all on the same network then they will come from the public facing gateway's ip address. Not possible.
-
Learn some Javascript and post your efforts. We are not here to write code for people too lazy to learn.
-
Please help me with javascript for multi level menu
trq replied to linux1880's topic in Javascript Help
This board is for help with existing code, not help finding it.