Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. What exact output are you getting and what exactly is wrong with it? What's the expected output?
  2. Since you are not calling your ->db_select() method any where in your code, you haven't selected a database for the queries to operate on, ergo the error message you are getting. If you were calling it, the database selection would be specific to the database connection you are supplying to the mysql_select_db() statement.
  3. All the relevant parts would be ALL the code (less any database credentials), from the start of login.php up through the line where the error is occurring at. That would include (pun intended) your code showing how you are including the various files, along with showing the php tags in your file(s). You either are including using a URL (doesn't include php code, only the output you send), don't have full php tags, or have multiple files at different paths, some with and some without that function definition in it.
  4. Here's a readable version of your error (there's a remove format button, looks like an eraser) -
  5. You have to execute a query against each table that you want to update. There's no 'all tables' wild-card statement.
  6. The image you posted only shows the human readable date/time, not the actual key/values in your array. I'm going to guess you have a wrong parameter in the conversion between unixtimestamp and the date/time value so that the date/time values don't actually correspond to the unixtimestamps you are sorting by.
  7. Where exactly are you calling your ->db_select() method?
  8. It's likely that your form isn't submitting the variables that your php code is expecting. What is your form?
  9. Your setResByMatch() function code is not correct. is_int doesn't test if the content of a variable is an integer, it tests if the variable type is an integer.
  10. And you could just JOIN your two queries, execute the one query, and loop over the results.
  11. The problem is because cookies (the session id cookie in this case) are by default specific to the variation of the domain where they were created at. Because you are not setting the session id cookie domain setting to match all variations (with and without www.) of your domain, it only matches the variation where it was set at. A) You should be constant in your use of www or no www on your domain/links, B) You can redirect all non-www requests to the www version of your domain in a .htaccess file. C) You can set the session id cookie domain to be .yourdomain.com (with the leading dot.) See this link - session_set_cookie_params
  12. If you mean reusing the result set, no, you can perform a seek statement to return the result pointer to the first (or any other) record - mysql_data_seek
  13. If you removed that line of code and there was no change in the output, then either you didn't save the file, upload the file to your server, or caching somewhere between the file and your browser is showing the previous results. If you are getting a mysql_num_rows value of 2, then running a total of 2 mysql_fetch_assoc statements will fetch those 2 rows.
  14. http://jpgraph.net/
  15. ^^^ Why do you have a line of code that is fetching a row from the result set before the start of your while(){} loop? Wouldn't that mean that your while(){} loop will start at the second record in the result set?
  16. The error is because your $c2 variable is empty or it contains a non-numerical value that is breaking the syntax of the query statement. You need to form your sql query statement in a php variable ($query) and echo it so that you can see exactly what it contains. Where is the $c2 variable being set at and why didn't your validation logic prevent the query from being executed without a valid number in $c2 (opponent_team_id)?
  17. From php.net itself - http://windows.php.net/downloads/releases/archives/
  18. What exactly are you trying to accomplish? If the include statement is failing, the file isn't being included. If it's not being included, it's not being parsed, tokenized, and interpreted. if it's not being parsed, tokenized, and interpreted, there's no way to find and report the errors in it.
  19. P.S. I posted this in one of your previous threads, but your header() redirects (all) need exit; statements after them to prevent the rest of the code after that point from running while the browser requests the target url in the redirect.
  20. The name of your form field is not 'save', so $_POST['save'] will never be true. I was able to determine this by looking at your logic, but you should have been able to determine this by troubleshooting what your code and data are doing. If you expect your code to take a specific execution path, put in echo statements to check to make sure it is. If you expect variables to exist and have specific values, put in echo/print_r/var_dump statements to check exactly what they contain.
  21. In the case of PHP code being entered in the form field, there would only be a danger if you were causing the content from the form field to be executed as php code, either by eval'ing it at some point or saving it to a file as valid php code with <?php ?> tags around it and including it back into a .php script. I trust you are not doing either of these things, without fully validating what was entered in the form before using it. In the case of SQL being entered in the form field, see Psycho's post above. Posting your logic that is processing the form data before putting it into the query statement would be the best way for anyone to determine if it has any security holes.
  22. Posting your original thread/code as an answer to ignace's question has nothing to do with a question about a database class that uses PDO that can count queries. You seem to think that wrapping a database class around PDO, which is already a database class - as was already stated in your original thread, will somehow fix your error. It won't. Whatever change you made in your original code, from the time it worked, to the time it started producing that error is what caused the problem. You must troubleshoot why your code is producing that error. Stick to your original thread for your original code and question. If you want someone to help you find a database class that used PDO that can count queries, that's what this thread is for. Don't switch back to your original code/error in this thread.
  23. The php coding help forum section is for help with actual code you are writing. It's not for asking for code. Moving thread the misc forum section... Also, the sample code you posted can only execute simple queries without any parameters in them since it does not have anyway of binding parameters to the prepared query statement. So, it's too simple as it is.
  24. The dll that you use with apache 2.2 is - php5apache2_2.dll though I'm not sure that alone is causing the error you are getting.
  25. A) Do you really need seconds resolution? You could divide the values, inside the sum() term, by 60 or 3600 to get minutes or hours resolution. B) What's the goal of doing this anyway? Wouldn't you sum just the values for tickets that are still 'open'? C) You can do a PDO fetchall for just that column and do a php array_sum to get the result. No loop needed.
×
×
  • 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.