Php : How to get the id from the name -


i have table name manager , have 2 fields manager_id,manager_name. i'am trying manager_id manager_name. not showing result , error.

this code.

<?php      $jdata = $_get['js'];      $result = json_decode($jdata,true);      $name=$result['mname'];      $conn=mysqli_connect('localhost','root','root','projmanagement');       $mid = mysqli_query($conn, "select manager_id manager manager_name=".$name);      echo $mid; ?> 

i'am getting value if print $name. can't value $mid.

mysqli_query returns boolean ( true or false ) normal php behavior.

php > = false php > print php >  

you should update query. single quotes should used string values.

 $mid = mysqli_query($conn,      "select manager_id manager manager_name='".$name."'"); 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -