Hello guys,
Please give me a little help in a mysql_query (select)...
At the moment, I have this in ID order:
http://i.imgur.com/7fclwVp.png
But I want to order by date... can someone help me how to do it?
This is my code:
This is my variables:
And this is my database tables:
http://i.imgur.com/hQfKct8.png
http://i.imgur.com/OizPuST.png
http://i.imgur.com/78dkOy7.png
Like I have, ordered by ID, is getting the info from prefix."posts";
And the date that I want, I need to get from prefix."postmeta";
Here you can see the meta_value that I need: http://i.imgur.com/78dkOy7.png
Here is a mysql_query("select getting from prefix."postmeta"; maybe is useful:
Can someone please help me?
Thank you very much!!
Please give me a little help in a mysql_query (select)...
At the moment, I have this in ID order:
http://i.imgur.com/7fclwVp.png
But I want to order by date... can someone help me how to do it?
This is my code:
PHP:
$listFgpost =mysql_query("select * from $postTab where post_type='freegallery' and post_status='publish' and post_parent='$mrpostParent' order by ID DESC limit $start,$limit");
This is my variables:
Code:
$postTab = $wpdb->prefix."posts";
$postMeta = $wpdb->prefix."postmeta";
And this is my database tables:
http://i.imgur.com/hQfKct8.png
http://i.imgur.com/OizPuST.png
http://i.imgur.com/78dkOy7.png
Like I have, ordered by ID, is getting the info from prefix."posts";
And the date that I want, I need to get from prefix."postmeta";
Here you can see the meta_value that I need: http://i.imgur.com/78dkOy7.png
Here is a mysql_query("select getting from prefix."postmeta"; maybe is useful:
PHP:
$query=mysql_query("select * from $postTab as a,$postMeta as b where a.ID=b.post_id and a.post_type='model' and a.post_status='publish' and b.meta_key='mr_model_appear_sites' and FIND_IN_SET($mrpostParent,b.meta_value) order by a.ID DESC");
Can someone please help me?
Thank you very much!!