Jump to content

Search the Community

Showing results for tags 'suffix'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hey guys, really hoping someone can help me with this I'll be extremely grateful! I am redesigning a website with a news archive type page using the mysql database from the previous version. The archive section contacts mysql and returns a number of values. In the archive section the previous version of the site uses a column called newsTitle to put information into the anchor url of the page which displays the full article. The problem is that there are duplicates in newsTitle. The previous website dealt with this by using php to add a suffix to the 1st duplicate of -0 , a suffix to the second duplicate of -1 and so on. I want to recreate this so I can keep the urls the same for seo purposes, otherwise I would just use the unique column newsID to seperate each article. Here's a simplistic version of my code so far. If anyone can come up with a way to add the suffixes to $title I will be soooo happy! Really appreciate your time and assistance. mysql_connect($host, $user, $pass) or die ("Unable to connect!"); @mysql_select_db($db) or die ("Unable to select database!"); $querytable="SELECT * FROM tblnews WHERE YEAR(newsDate) >= $startyear AND YEAR(newsDate) <= $endyear AND newsPageID = 13 ORDER BY `tblnews`.`newsDate` DESC"; $result=mysql_query($querytable); $sql = "SELECT * FROM tblnews WHERE YEAR(newsDate) >= $startyear AND YEAR(newsDate) <= $endyear AND newsPageID = 13 ORDER BY `tblnews`.`newsDate` DESC LIMIT $offset, $rowsperpage"; $result3 = mysql_query($sql, mysql_connect($host, $user, $pass)) or die ("Unable to connect!"); mysql_close(); $i= ($currentpage - 1) * 4; while ($list = mysql_fetch_assoc($result3)) { $title=mysql_result($result,$i,"newsTitle"); $url = strtolower ($title); ?> <div id="release"> <p> </p> <h3><a href="questionsarticle.php?pagetitle=<?php echo $url; ?>"><?php echo $title; ?></a></h3> <p> </p> </div> <?php $i++; }
×
×
  • 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.