1

I'm trying out jqgrid and I can't figure out this query, specifically what a, b, client and client_id are?

$result = mysql_query("SELECT COUNT(*) AS count FROM table_name a, clients b WHERE a.client_id=b.client_id");

I'm trying to adapt the code from one of the demos of the site and this doesn't seem to be explained anywhere.

Any help would be great.

mao
  • 1,059
  • 2
  • 23
  • 43

1 Answers1

1

The syntax FROM table_name a, clients b is pulling records from the tables table_name and clients.

When you see a later in the query, it's referring to the table named table_name and b is referring to the table clients.

Mark Biek
  • 146,731
  • 54
  • 156
  • 201
  • ahh, I see. I think I was being thrown off be the fact there is no mention of a second table named clients in the example. Thanks, that makes sense. – mao Mar 25 '12 at 19:55