ferlicia Posted July 21, 2011 Share Posted July 21, 2011 $user = $_POST['user']; $result_1= mysqli_query($link, "SELECT * FROM criteria ORDER BY gpa ASC"); --> for the gpa, i wanted to put in the $user but there will be an error $array = Array(); $team1 = Array(); while($info = mysqli_fetch_array($result_1)){ // echo $info[1]; array_push($array, $info[1]); --> $info[1], i wanted to put in the $user also, but there will also be an error. } Link to comment https://forums.phpfreaks.com/topic/242511-error-please-help/ Share on other sites More sharing options...
abdfahim Posted July 21, 2011 Share Posted July 21, 2011 $user must contain a valid field name $result_1= mysql_query("SELECT * FROM `criteria` ORDER BY `".$user."` ASC"); Link to comment https://forums.phpfreaks.com/topic/242511-error-please-help/#findComment-1245503 Share on other sites More sharing options...
Muddy_Funster Posted July 21, 2011 Share Posted July 21, 2011 That makes no sense - if $user is a value, and not a field name - also, there is absoloutly no need for backticks in that query. Link to comment https://forums.phpfreaks.com/topic/242511-error-please-help/#findComment-1245646 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.