Jump to content

Wildthing

Members
  • Posts

    4
  • Joined

  • Last visited

Wildthing's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Doing my head in lol $result = mysql_query("SELECT rep_surname, COUNT(*) as tot FROM appointments GROUP BY rep_surname order by ASC LIMIT 1"); echo $row['rep_surname']; --------------------------------------------- error in apache log PHP Notice: Undefined variable: row in /home/wildthin/public_html/grabbs/test.html on line 10
  2. So far I have $result = mysql_query("SELECT rep_surname, COUNT(*) as tot FROM appointments GROUP BY rep_surname ORDER BY tot"); Need it to echo the rep_name with the least amounts of "1" in booked field kind of stuck
  3. mysql> select rep_surname, AVG(booked) from appointments group by rep_surname; +-------------+-------------+ | rep_surname | AVG(booked) | +-------------+-------------+ | nick | 1.0000 | | john | 1.0000 | +-------------+-------------+ 2 rows in set (0.00 sec) But there are 3 rows all all, John has 1 more entry Did I miss something ? I am not real good at this
  4. I have a simple test table in mysql fields name, booked, 3 entries nick, 1 john, 1 nick, 1 I want to echo out the name with the least amounts of booked sum so output should be john can anyone help ?
×
×
  • 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.