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

  • Home
  • SEARCH
  • 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 7704195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:37:53+00:00 2026-05-31T23:37:53+00:00

Original SQL query is this; SELECT id,post_title,post_date FROM wp_posts where id=’1′ When I retrieve

  • 0

Original SQL query is this;
SELECT id,post_title,post_date FROM wp_posts where id=’1′

When I retrieve the record, I am finding it but when it comes to returning the results, I am puzzled. Here is the where I got stuck.

   while ($row = mysql_fetch_assoc($RS)) :
      print_r ($row); 
      list($id,$post_title,$post_date) = $row;
   endwhile;

print_r ($row) outputs this;
Array ( [ID] => 1 [post_title] => Hello world! [post_date] => 2012-03-27 03:28:27 )

And when I run the list function in there ( for debug purposes obviously ), I get this;

Notice: Undefined offset: 2 in F:\inetpub\wwwroot\whatever\sql.php on line 147
Notice: Undefined offset: 1 in F:\inetpub\wwwroot\whatever\sql.php on line 147
Notice: Undefined offset: 0 in F:\inetpub\wwwroot\whatever\sql.php on line 147

What’s causing this?

  • 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-05-31T23:37:54+00:00Added an answer on May 31, 2026 at 11:37 pm

    Replace:

    mysql_fetch_assoc($RS)

    with:

    mysql_fetch_array($RS, MYSQL_NUM)

    then it should work, because the list function trys to access the array using numeric keys.

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

Sidebar

Related Questions

I'm having difficuly mapping a simple T-SQL query such as this select min(price) as
Consider the following SQL Server 2005/2008 query: Select [UID], [DESC] From SomeTable Order By
I am trying to get this SQL query to grab 1 more thing from
Imagine I have the following SQL query: SELECT id,name FROM user WHERE id IN
Jeff Atwood asked the original question about parameterizing a SQL IN clause , but
I'm not very good at SQL, but I'm certainly learning. So this one provides
I have problems with a query in NHibernate. The original SQL query looks like
I have a query like this: SELECT A, B, C, CASE WHEN 1 =
I have the following SQL Query: select Subjects.S_ID as ID, Subjects.S_ParentID as ParentID, Subjects.S_Name
I am attempting to insert many records using T-SQL's MERGE statement, but my query

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.