Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Here's what you have to do: - Put your table tags outside the while loop. - You need to use the modulus operator (%) to see if the total number of columns is divisible by 10 (every 10) and create a new row.
  2. I'm confused, what does "it doesn't take it" refer to?
  3. Do you mind sharing your final code?
  4. If you don't mind, could you share the solution?
  5. Either that ---^ (which is the best suggestion IMO) or use Google! There has to be 10's of thousands of reliable and/or helpful results.
  6. Someone must be bored... See if his ip matches another in the db.
  7. You need to put the table tags outside of the while loop.
  8. Yes, this is good practice. If you look in the manual, it's recommended. You should probably use exit rather than die. The point of this is to ensure the code after the header redirect is not executed.
  9. I assume you haven't tried Google yet? You took the time to sign up on the forums and ask this question, but haven't done anything yourself? There has to be millions of helpful results.
  10. I need the PHP part as well.
  11. SUM(). When and what conditions? Don't follow here either. Possibly, you can use a sub-query to handle this and grab the sums for each event.
  12. Like I said, please post the relevant code.
  13. Can you post the relevant code? You said you want to display every 10 rows, yet your example does not exemplify this. You have to use the modulus (%) operator in your while loop to check if the row count is divisible by 10 (every 10 rows). NOTE - Is there a reason you posted in the Framworks section? If not, I can move this to the more popular, "PHP Help" for additional help.
  14. Change this: $row = mysql_fetch_array($result); to this: while($row = mysql_fetch_array($result)) { Don't forget to add the closing '}' at the end of your script. I also don't get the point of this line: while($i Won't that just display the same record 5 times?
  15. Hey darkfreaks, did you resolve this yet?
  16. SELECT * FROM my_table WHERE my_field REGEXP '^[a-zA-Z\s]+\d{8}$'; - Assumes there's no space after the last word (in your examples, "Shop" & "Gallery"). - Assumes the digits have to exactly 8 digits in length. - Will match on something like, "Dublin123456578". (I'm not sure how to flag case-insensitivity in the MySQL regex world, that's why I included "a-zA-Z") Good luck.
  17. What are the errors you're receiving?
  18. If you want to properly fix it, implement my suggestion and post the current code. (You can mark the top "Not Solved" again, by clicking the same button as marking it solved.)
  19. This should do was you want. SELECT country, COUNT(*) AS num FROM table GROUP BY country;
  20. He's a troll, please refrain from giving him anymore food..
  21. SELECT DISTINCT country FROM table Do you want the count of each one as well?
  22. Remove this line: $sql = mysql_query("DELETE FROM users WHERE username = '$username'");
  23. First, you need to pass an array to the POST. So change the name to: name=\"first[]\" Second, you would have to add these conditions to your query, dynamically. Either loop through and build 1 query, or loop through and execute multiple queries.
  24. I thought about that but I thought I would have to do that from the php side and was trying to avoid that. I didn't know you could do it from the mysql side. Thanks!!! In this case PHP would have nothing to do with the query except for retrieving the desired vin #. The final query should look something similar to: SELECT mileage, gallons FROM fuel WHERE vin = '$vin' ORDER BY `date` DESC LIMIT 2; NOTE - If this problem is completely resolved then you should mark it so by clicking the "Topic Solved" button in the bottom left right above "Quick Reply". Good luck.
×
×
  • 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.