[thelist] Query help?

rudy r937 at interlog.com
Sun Feb 23 07:18:01 CST 2003


> I think its this query i need to change but I am not getting anywhere..
> $result=mysql("$DBName","SELECT * FROM category ORDER BY Category");

yes, pass the selected city to this query

  select categoryid, categoryname
    from category
   where cityid = $cityid
  order by categoryname

i changed your query slightly so that it doesn't use "select star"

in so doing, i had to guess at the column names

which is what you'll do when you come back to a "select star" query and
wonder which columns it actually uses

another thing i did was change the column category to categoryname

i realize that syntactically you can have a table and column with the same
names, but i never do


rudy




More information about the thelist mailing list