Jump to content

Backslider

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Backslider

  1. I am assuming that you are paginating, in which case I would just use a regular COUNT(*) query - you always need two queries for pagination, even if you use sql_calc_found_rows (which may not perform as well).
  2. I am sure that if we had you structuring the query that would be the case. Please think about what you are saying before you blurt out your own unknowledgeable fuffle.
  3. I did not attack anybody for trying to help. I called out a person, and rightfully so, for being a troll. Why? The "I know the answer, but I am not going to tell you, work it out yourself".
  4. Thanks for the try BagoZonde, however it doesn't meet requirements as it will only return rows that are not NULL and which the ID matches. FIND_IN_SET is better to use than LIKE for comma separated lists (that's what it's for).
  5. Perhaps with your eminent superiority, Jessica', you can explain to me why MySQL has 'find_in_set' if what you say is true?
  6. Ahhhhhh Jessica. Just what I wanted today. The resident "I know everything" troll. Seems that every tech forum has at least one of your ilk.
  7. With PDO you don't need to use 'sql_calc_found_rows'. After your normal select, simply use this: $rowcount = $pdo->query("SELECT FOUND_ROWS()")->fetchColumn();
  8. Just to give you a reality check on that: If my table has 25000 rows and I have 256 country IDs, then that gives me a possible 6,400,000 rows in my "normalized" table. Let's cut that in half for a realistic figure: 3.2 milliion rows. You REALLY think that is good??
  9. I'm really not here to be lectured on what you think is "bad". Were I to delve into CODD hell then I would end up with a table with many millions of rows just for country IDs. That's just plain dumb. MySQL has absolutely no problem whatsoever with delimited lists.
  10. If you know the Ajax URL, then that is all you need to get the content. How exactly depends on how the site is structured. If you have permission to use the content, why not just ask them for a database dump? If you don't have permission, then you are very likely breaking the law.
  11. For the $row, simply use: <?php echo ($c->is_admin == 'Yes')?$row:''); ?> For the second: <?php if($c->is_admin == 'Yes') { // do stuff } else { // do something else } ?>
  12. I have a table with a column that lists country ids as a comma separated list. Often this column is NULL, but other times it is not. How would I structure a query that checks this column and if not NULL will check if the user's country ID (PHP variable) is in the list of country IDs in the column and only return that row if it is?
  13. Hi, thanks for the reply. I actually solved this as follows: SELECT model FROM products WHERE model != '' AND model != '0' AND (model REGEXP '[0-9][a-z]' OR model REGEXP '[0-9]')
  14. I think its ok to show that the email is incorrect for password/ username reset/retrieval - I have never seen otherwise. I work almost exclusively on eCommerce systems, so if you cannot remember your username or password you can retrieve them with a valid email address - the login page will NOT tell you and this is as it should be for better security.
  15. The code look ok to me at a glance - probably a permissions problem where you are saving the image to. What is the error?
  16. At least the error you are seeing is a good one - I agree with Jessica that its output by the application itself. I cringe at the number of applications that will give a message like: "Your password is incorrect" - this immediately tells a hacker that they have a valid user name. It could be a problem with how the password is salted - may differ between your localhost and staging server, or a case sensitivity issue.
  17. No you cannot. You are better to register $param['name1'] (I assume this is the one you have trouble with) in $_SESSION and unset it when you are finished with it.
  18. I need to find valid records as part of a database cleanup script. What I need is a regular expression that will match, for a single column: records containing BOTH numbers AND letters (or any other character). records containing ONLY numbers (including decimals) Invalid records are those which contain ONLY letters and I do not want these returned, or NULL for the column. Anybody good with regex?
×
×
  • 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.