Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7824481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:36:49+00:00 2026-06-02T08:36:49+00:00

i have a table full of data in the form of value_id value_name value_timestamp

  • 0

i have a table full of data in the form of

value_id value_name value_timestamp

The first 5 columns have the same value name (with different id’s and timestamps)

how would i go about producing a conditional statement that went through and only displayed the first name with the same value. Ie i only want to show row 1, not 5 rows. then i want to display the 6th row’s name as its different

Ive had a go but with no luck –

 $sql = mysql_query("SELECT * FROM Films_Info") 
 or die(mysql_error()); 

while ($row = mysql_fetch_assoc($sql)) {
$name = $row['value_name'];  
if ("same as previous"($name)) {
    echo $name;
    }
    else 
    {
     //do nothing 
     }

}

Thanks guys

Table results –

film_id   film_name   film_date
1         example     Thursday
2         example1    Thursday
3         example3    Thursday
4         example4    Friday

So i want to display film_id 1 and its date, but skip 2 and 3 (film_id) as there the same, then display example 4.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:36:50+00:00Added an answer on June 2, 2026 at 8:36 am

    Change your sql statement to be specific.

    $sql = mysql_query("SELECT * FROM Films_Info WHERE name='{$name}'") or die(mysql_error());

    UPDATE: After some chat discussion, this is what you should do:

    while ($row = mysql_fetch_assoc($sql)) {
        $grouping = $row['film_date'];  
        $movies[$grouping][] = $row
    }
    

    This will group your same-date movies into an array for you to manipulate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table full of attendance data for students, we are migrating to
I have a table full of data called MYTABLE I used SELECT * FROM
I have a table of the form CREATE TABLE data { pk INT PRIMARY
I have a table full of data, and at the end of the row
In 1stpage I have a table with full of data, and end of every
I have a series of tables that contain data I want to full text
I have a table full of items that each have a unique ItemID .
I have a table full of longitude/ latitude pairs in decimal format (e.g., -41.547,
I have a table full of Dealers along with their latitude and longitude. I
I have a table full of bugs. The BugTitle is the page erroring and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.