Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. The page requests that are due to clicking on a pagination link need to use the SAME query that was originally used. The best way of accomplishing this would be to include the necessary values in the pagination URLs so that the same query can be built and executed. This would allow someone to bookmark a specific page and come back to the same results at a later time.
  2. Your original query had - ORDER BY Width, Height so that records with the same Width and Height were together in the record set. Why did you remove that from the query?
  3. If you find yourself putting a query inside of a loop, you can almost always use a single query to accomplish your task. Since you did not indicate what processing you do differently for the two cases, it is not possible to directly show a query that would work, but in general you would use GROUP BY Name to consolidate groups of data having the same name. You can then use COUNT(*) to get a count of how many rows are in each group (those having one row per name would have a count of 1), and if necessary you can use GROUP_CONCAT() to retrieve specific data items in each group.
  4. Your need to use full php opening tags <?php in all your code. Edit: Also, the instance of your connection class is only available inside the validateFields() function, unless you assign that to an object of your registration class.
  5. The view source you just post has nothing to do with the code you have posted. About all we can tell from the information supplied is that you are not even on a server with php installed.
  6. So, if you select no image and submit the form, what do you get? You should get your "Please select the image you would like to upload by clicking browse" message. That would be your first test case.
  7. When copy/pasting the actual code you are expecting help with, how can there be typo's?
  8. And you should have the error_reporting/display_errors settings turned on in your master php.ini or in a local php.ini or in your .htaccess file (the exact method that works is dependent on how php is running in your web server) so that the fatal parse errors will be reported and displayed.
  9. I think you should reread what thorpe posted and then read your query statement - The $dbh variable is NOT your table name, it is your database connection object. It does not belong in the query. Your table name belongs in the query.
  10. What does the 'view source' of the index.php page in your browser show for that part of the page?
  11. http://dev.mysql.com/doc/refman/5.0/en/update.html
  12. EVERYTHING that is between the <textarea></textarea> tags in your source code is part of the data of that text area. You would need to put the </textarea> tag immediately following the closing ?> php tag - ?></textarea>
  13. You need a public mail server to send an email to anyone other than yourself. A public mail server is a valid mail server that has a domain name associated with it and has all the necessary DNS records setup so that a receiving mail server can check and will accept emails from the sending mail server. What exactly are you trying to accomplish?
  14. You don't echo require/include statements anyway, so echo <?php require "footer.php"; ?> doesn't make sense at any time. You just use require "footer.php"; at the point in the php code where you want to require "footer.php". If you want to conditionally do that, you put the require "footer.php"; statement inside of an if(){} conditional statement.
  15. I would also recommend some quotes around 'quiz' in your mysql_select_db() so that php doesn't waste time trying to find a defined constant by that name, then trying it as a string.
  16. For the specific error message you posted, the only way I could produce the same is if $this->connection was a valid mysqli connection, but had already been closed by the time your __destruct() function was called. Without further details of your actual code, it's not possible to directly help further. Edit: I'm going to take a wild guess that you are also passing the mysqli connection into ANOTHER class(es) and one of them is closing the connection when your script ends as well, so you get the posted error in your db_manipulation class? If so, you should not be manipulating the mysqli connection in a class that is just using that connection. You should only manipulate/close the connection in the scope that opened the connection.
  17. Try this code as well, exactly as shown - <?php phpinfo(); ?>
  18. A) Your code works for me, B) You don't need to use a reference in this case, C) Are you sure your mysqli connection worked? Your code just tests if you have a value, not if it is a valid connection. D) Showing your complete code that produces (reproduces) the error is always the fastest way of getting a solution.
  19. phpmyadmin is a php script, so php is working (unless you have a separate web server in addition to what wamp installed.) Post one of your php scripts that does not work, showing the opening php tag being used in the file.
  20. ^^^ That doesn't mean anything in this case because the .php page is the target of a form submission. Directly requesting it SHOULD produce undefined index errors. You should however be testing if the form was submitted BEFORE referencing any of the form data. This is typically done by testing if the named submit button isset() and only executing the form processing code if it is. I tried your form and form processing code and it does display the validation messages (at least the ones I tried) and if all the fields have values it does display the we will get back to you within 1 week ... message. If you got a blank page, you are probably not doing this in an environment where the .php file is being processed through the php language engine or the actual code is not the same as the code you posted and the actual code contains a fatal parse error.
  21. If you read the code carefully, you will notice the the HEADING is output inside the if(){} conditional statement. The actual data is unconditionally output immediately following the closing } of the if(){} conditional statement.
  22. Cannot directly help you without knowing where the error message states the OUTPUT is occurring AT. You likely have output_buffering turned on in your php.ini, which is hiding the problem on your local development system and the output is probably the BOM (Byte Order Mark) characters that your editor is placing at the start of one or more files.
  23. See the following post - http://www.phpfreaks.com/forums/index.php/topic,312770.msg1476717.html#msg1476717 You will need to alter the current category code to use the $row['Width'].'x'.$row['Height'] value.
  24. ^ is an exclusive or bitwise operator, not a mathematical operator.
  25. The mysql md5() function is not quoted as that would make it string data, not a function. However the string parameter it accepts is quoted - $query = "SELECT * FROM users WHERE username = '$username' AND password = MD5('$password')";
×
×
  • 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.