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. } Quote 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"); Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/242511-error-please-help/#findComment-1245646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.