Jump to content

jagdish kothapalle

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by jagdish kothapalle

  1. 1. For the query, $qry = "SELECT * FROM `products` where price > avg(price)" try the below one $qry = "SELECT * FROM products where price > (select avg(price) from products)" The mysql engine doesn't understand avg(price) unless you have a variable something like $avgprice (which is already assigned) passed from your php. 2. Ideally, you can use multiple fields in group by clause provided they are also present in the select clause.
  2. Hi, If there is no mysql error and nothing is getting updated, then the where condition is not getting satisfied. It ought to be either of the two.
  3. Debugging is the best way to solve it. Simplest way would be to echo the query and see the output of the query string. Should solve your purpose.
  4. Hi, I tried replicating the issue and the records are getting inserted properly. I believe the issue got fixed. Kindly close the thread.
  5. Hi, To make it on an illustrative note, you have to convert into timestamp to calculate the difference. time() function is a php function which gives the current timestamp unix_timestamp(date) gives you the timestamp of your stored date. You can use these two timestamp variables in php to calculate the difference which will be in seconds
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.