$sql="select *, (select Faculty from userinfo where Faculty=$college) as category from award where HonoringYear=$year";
               $rs=mysql_query($sql);
               return $rs;

Recommended Answers

All 3 Replies

Replace line 2 with:

$rs = mysql_query($sql) or die(mysql_error());

It could be a problem with the sub-select, but hard to diagnose without any sample data.

Also single quotes around $year

 AS category FROM award WHERE HonoringYear='$year'";

(also, makes easier reading if you capitalise )

... and also add single quotes to this line;

..select Faculty from userinfo where Faculty='$college'
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.