我在我的profileTable表中有一个名为"Associations"的列,我正试图查询与这些关联相关的个人资料。
$sql = mysqli_query($con,"SELECT * FROM profileTable WHERE Keyword_ID LIKE
'%".$getKeyID."%' ORDER BY Associations <> 'School of Engineering
and Computer Science', Associations AND LaName ASC LIMIT $start,$end");
我可以按教育程度对个人资料进行索引,但不能按协会进行索引。
while ($row = mysqli_fetch_array($sql)) {
$key = $row['Keyword_Name'];
$keyID = $row['Keyword_ID'];
$fname = $row['FirName'];
$lname = $row['LaName'];
$mname = $row['MName'];
$suffix = $row['Suffix'];
$title = $row['Title'];
$title2 = $row['Title2'];
$title3 = $row['Title3'];
$education = $row['Education'];
$education2 = $row['Education2'];
$education3 = $row['Education3'];
$dept = $row['Dept'];
$phone1 = $row['PH1'];
$phone2 = $row['PH2'];
$email = $row['Email'];
$photo = $row['Photo'];
$bio = $row['BioLK'];
$website = $row['Website'];
$assocs = $row['Associations'];
$actions=array('School of Engineering and Computer Science'=>'Computer Science
and Engineering');
我需要将关联数组和$key(单词)相关联,这样如果用户点击“计算机”关键字,它将与“工程与计算机科学学院”相关联,并首先将其索引到“工程与计算机科学学院”中。
这在其他列(如“教育”)上的运作很好,但似乎无法在我的关联数组中起作用。有什么想法吗?
例子sqlfiddle: http://sqlfiddle.com/#!2/c1802/7/0