Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. ShugNiggurath

    PHP ereg syntax problem

    Thank you Feherke, it's a doddle when you spot it. I've been toying with the pattern that long I don't even think I was looking at the string. Wood for trees! Cheers H
  2. ShugNiggurath

    PHP ereg syntax problem

    Hi, I have the following code: if (!ereg('^[a-z_]$', '$sec')) { // failed url validation echo "You are not allowed to access this page in that way"; } else { $sec is a variable passed in the URL that I want to make sure is only lowercase letters or underscore, the above code fails...
  3. ShugNiggurath

    reset autoincrement counter

    I'm not totally sure what you mean here, but the best you can do is reset the auto_increment value to one greater than the highest value (otherwise mySQL would try and overwrite the value when it found it in an existing record). Use phpMyAdmin, enter your tables structure and choose Operations...
  4. ShugNiggurath

    Using PHP mySQL to create 'most read' stories

    It's OK, I got it working. I was trying to use DATE_SUB earlier and I stupidly broke the query by using bad syntax, so I was trying to use straightforward arithmetic to test the string. The syntax I am now using is as follows; SELECT * FROM news WHERE sec='$sec' AND unix_timestamp(published)...
  5. ShugNiggurath

    Using PHP mySQL to create 'most read' stories

    Hello, I'm not an expert in mySQL, hence being here! I've a database 'news' that has several sections 'sec', I store records as 'published' and have a counter 'read_count' which is increased by 1 each time it is viewed. I want to be able to list the top 6 stories as most read, but want also...

Part and Inventory Search

Back
Top