The original SQL query is this; SELECT id, post_title, post_date FROM wp_posts, where id = '1'
When I retrieve a record, I find it, but when it comes to returning results, I am puzzled. This is where I am stuck.
while ($row = mysql_fetch_assoc($RS)) : print_r ($row); list($id,$post_title,$post_date) = $row; endwhile;
print_r ($ row) prints this; Array ([ID] => 1 [post_title] => Hello world! [Post_date] => 2012-03-27 03:28:27)
And when I run the list function there (for debugging purposes explicitly), 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 causes this?
source share