About 15 results: "mysql_query repo:wlynch92/cs336-dbproject"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On
profile.php in cs336-dbproject https://bitbucket.org/wlynch92/cs336-dbproject.git | 295 lines | PHP
  1. 
                        
  2.     $message = mysql_query("SELECT u2.username sender, m.subject, m.time, m.content FROM user u1, user u2, message m WHERE u1.uid=m.ownerid AND u2.uid=m.senderid AND u1.username='$user'");
  3. 
                        
  4.     $pending = mysql_query("SELECT u1.username requesting, u1.uid uid FROM user u1, user u2, pending_friend p WHERE u1.uid=p.requesting AND u2.uid=p.requested AND u2.username='$user'");
  5. 
                        
  6. $userinfo = mysql_query("SELECT * FROM user u WHERE u.username='$user'");
  7. $education = mysql_query("SELECT * FROM user u, attended a, school s WHERE u.uid=a.uid AND a.sid=s.sid AND u.username='$user'");
  8. $employment = mysql_query("SELECT * FROM user u, company c, employment e WHERE u.uid=e.uid AND c.cid=e.cid AND u.username='$user'");
  9. $songresult = mysql_query("SELECT * FROM user u, song s, likesSong ls WHERE ls.sid = s.sid AND ls.uid = u.uid AND u.username ='$user'
  10.     GROUP BY s.sname");
  11. $artistresult = mysql_query("SELECT * FROM user u, artist a, likesArtist la WHERE la.aid = a.aid AND la.uid = u.uid AND u.username = '$user' GROUP BY name");
  12. $activityresult = mysql_query("SELECT * FROM user u, activity a, interested_in i WHERE i.uid = u.uid AND i.actid = a.aid AND u.username = '$user' Group BY aname");
  13. $friendslist = mysql_query("SELECT u2.username FROM user u1, user u2, friend f WHERE ((u1.uid=f.user1 AND u2.uid=f.user2) OR (u1.uid=f.user2 AND u2.uid=f.user1)) AND (u1.username='$user')");
  14. $mutualfriends = mysql_query("SELECT u2.username FROM user u1, user u2, friend f WHERE ((u1.uid=f.user1 AND u2.uid=f.user2) OR (u1.uid=f.user2 AND u2.uid=f.user1)) AND (u1.username='$curr') AND u2.username IN (SELECT u2.username FROM user u1, user u2, friend f WHERE ((u1.uid=f.user1 AND u2.uid=f.user2) OR (u1.uid=f.user2 AND u2.uid=f.user1)) AND (u1.username='$user'))");
  15. $relationship = mysql_query("select u2.firstname, u2.lastname, r.status, u2.username from user u1, user u2, in_relationship_with r WHERE ((u1.uid=r.user1 AND u2.uid=r.user2) OR (u1.uid=r.user2 AND u2.uid=r.user1)) AND (u1.username = '$user')");
  16. 
                        


random.php in cs336-dbproject https://bitbucket.org/wlynch92/cs336-dbproject.git | 166 lines | PHP
  1.         $query = "select count(*) as count from user where gender = 'Male'";
  2.         $res = mysql_query("$query");
  3.         $query = "select count(*) as count from user where gender = 'Female'";
  4.         $res = mysql_query("$query");
  5.         $query = "select count(DISTINCT l.uid)/count(DISTINCT u.uid) as count from likesSong l , user u";
  6.         $res = mysql_query("$query");
  7.         $query = "select s.sname as name, AVG(YEAR(CURDATE())-YEAR(birth)) as avg from user u, attended a, school s where a.sid=s.sid and u.uid=a.uid group by a.sid;";
  8.         $res = mysql_query("$query");
  9.         $query = "select distinct username,sname,mcount from (select u.username, a.uid,count(m.mid) as mcount from user u, attended a, message m where u.uid=a.uid and m.senderid=a.uid group by a.uid) as c, (select a.sname,a.sid,a.mcount/b.scount avg from (select s.sname, s.sid,count(m.mid) as mcount from school s, attended a, message m where s.sid=a.sid and m.senderid=a.uid group by s.sid) as a, (select sid,count(distinct uid) as scount from attended group by sid) as b where a.sid=b.sid) as d, attended at where c.mcount>=avg and at.uid=c.uid and at.sid=d.sid";
  10.         $res = mysql_query("$query");
  11.         $query = "select c.username as name1, b.username as name2 from (select u.uid,sid,username from attended a, in_relationship_with r,user u where r.user1=a.uid and a.uid=u.uid) as c, (select u.uid,sid,username from attended a, in_relationship_with r, user u where r.user2=a.uid and a.uid=u.uid) as b, in_relationship_with r where c.sid=b.sid and (c.uid=user1 and b.uid=user2) or (c.uid=user2 and b.uid=user1)";
  12.         $res = mysql_query("$query");
  13.         $query="select DISTINCT count(*) as count from ".$_POST['topic'];
  14.         $res = mysql_query("$query");
  15.     $query="select u.username as name from user u, likesArtist l, artist a, attended at, school s where s.sid=at.sid and u.uid=at.uid and u.uid=l.uid and a.aid=l.aid and a.name=\"".$_POST['artist']."\" and s.sname=\"".$_POST['school']."\"";
  16.     $res=mysql_query($query);









query.php in cs336-dbproject https://bitbucket.org/wlynch92/cs336-dbproject.git | 51 lines | PHP
  1.         //echo $query."\n";
  2.         $res = mysql_query($input,$con);



index.php in cs336-dbproject https://bitbucket.org/wlynch92/cs336-dbproject.git | 61 lines | PHP
  1. 
                        
  2.     $result = mysql_query("SELECT * FROM user u WHERE u.username='$user'");

Back to Top