Search the Community
Showing results for tags 'desc'.
-
I have a Mysql table where I store prices of a product. I have the values in "varchar" format because I needed to include "decimals" in the prices(for eg. 15.30) and "int" doesn't allow that. Having done that, when ever I filter the products by prices in Ascending or Descending order, they don't show up in proper order. It seems like the decimal in the prices is messing up the order. Is there a way to fix this so that the php query can filter the prices in proper order despite the decimals? Here's the eg of the query. $get_records = $db->prepare("SELECT * FROM records ORDER BY records.price DESC");
-
Hi friends, I'm using Kalins pdf in Wordpress. Where in the code below can I arrange these comments using "ORDER by comment_date DESC"? I have tried for weeks and I keep getting blank pages. I'll appreciate your input: function commentCallback($matches) { if(defined("KALINS_PDF_ COMMENT_CALLBACK")){ return call_user_func(KALINS_PDF_COMMENT_CALLBACK); } global $post; $comments = get_comments('status=approve&post_id=' .$post->ID); $commentString = $matches[2]; foreach($comments as $comment) { if($comment->comment_author_url == ""){ $authorString = $comment->comment_author; }else{ $authorString = '<a href="' .$comment->comment_author_url .'" >' .$comment->comment_author ."</a>"; } $commentString = $commentString .'<p>' .$authorString ." - " .get_comment_date(null, $comment->comment_ID) ." @ " .get_comment_date(get_option('time_format'), $comment->comment_ID) ."<br />" . $comment->comment_content ."</p>"; } //get_comment_date('m-d-Y @ g:i A', $comment->comment_ID) return $commentString .$matches[4]; }