php - Call to undefined function MYSQL_NUM_ROWS() -


this question has answer here:

i trying validate login php getting error :

fatal error: uncaught error: call undefined function mysql_num_rows() in /opt/lampp/htdocs/social/index.php:100 stack trace: #0 {main} thrown in /opt/lampp/htdocs/social/index.php on line 100

here code

if(isset($_post['login'])){          $studentid = $_post['studid'];           $pass = $_post['password'];          $query2 = mysqli_query($con, "select * members student_id = '$studentid' , password = '$pass' ") or die (mysqli_connect_error());          while($studid = mysqli_fetch_object($query2))             {             echo "$studid->member_id";             }             $numberofrows = mysql_num_rows($query2);             if ($numberofrows == 0)                 {                  }             else if ($numberofrows > 0){                     $wewness = mysql_query("select * members student_id = $studentid")or die(mysql_error());                     $getid = mysql_fetch_array($wewness);                     if($getid['account_status']==0){                         $_session['login'] = 'maybe';                         $_session['member_id'] = $getid['member_id'];                         $_session['studentid'] = $getid['student_id'];                         header('location:registerexec.php');                     }elseif($getid['account_status']==2){                         $_session['login'] = 'true';                         $_session['member_id'] = $getid['member_id'];                         $_session['studentid'] = $getid['student_id'];                         header('location:hometest.php');                      }elseif($getid['account_status']==1){                         $_session['login'] = 'maybe';                         $_session['member_id'] = $getid['member_id'];                         $_session['studentid'] = $getid['student_id'];                         header('location:fill.php');                      }                 }             } 

for php version above php 5 have use mysqli_ functions

mysqli_num_rows() 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -