Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Who would bother to look past page 1 of a result set with 10k rows in random order, without applying a logical order?
  2. IF(t1.date_expires >= NOW(), IF(t2.date_expires >= NOW(), true, false), false) should work.
  3. $arr2[] = explode(",",$_POST['hidden-tags']); Remove the [] and your arrays will have the same number of dimensions.
  4. You know how you have login.login_id to specify the table.column? DO that for the other column.
  5. A number cannot be both 3 AND 4. It could be ..... 3 OR 4.... If you just want the entire count remove the group by.
  6. A user level can't be both equal to 3 and equal to 4. There is no such number. Furthermore, if you want the output you said in your first post, you don't want the number of rows returned, you want the actual rows.
  7. You'll need to use COUNT() and GROUP BY in your query. Check out the MySQL documentation and give it a shot.
  8. Every single example on the page shows how to do that: http://php.net/mysql_fetch_array
  9. I told you where your error is, did you fix it?
  10. Edit your php.ini to set display_errors to 1 and error_reporting to -1. It's a lot easier to just read them on the screen (when in development environment) than a log file.
  11. A query should be: SELECT fields FROM table. You use quotes around strings, and % is a wildcard for searching. However if that exact query works in command line, your table is named literally '%stocktable%' Do SHOW TABLES; and see what it says.
  12. You really should rename your table so it's just stocktable. Or even better: stock. And WHERE 1 is superfluous.
  13. Make sure you have error reporting turned on ,then capture MySQL errors. A blank page means you have a fatal PHP error, which you should be able to see by enabling error_reporting set to E_ALL. If this is your actual code, the problem is the line after the query(). You're missing something vital.
  14. There's tons of examples in the manual. Post your code and we can help.
  15. After rereading your post its possible your confirm_query function does that, requinix found the problem in your posted code. But ensure your code does capture SQL errorsz
  16. You need to check for SQL errors after running the query. See the link in my signature.
  17. You need to update the HTML headers on the page to let the browser know its a new version.
  18. The problem is the use of "insert" but OP needs to learn to capture mysql errors.
  19. You need to check for errors. See the link in my signature on debugging SQL.
  20. Just thinking out loud, but if all he wants is the first and last, wouldn't it be better to just do two queries, one ASC and one DESC? If OP is going to use the results at all that's different, but hypothetically if he only wants first and last?
×
×
  • 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.