PHP only printing 1st line of MySQL textfield with multiple lines. Using mysqli -


i trying print result of mysqli query in php displaying first line , there multiple lines in text field. can me know command need use?

thank you.

result = $mysqli->query("select somedata sometable id='bob' , group='thegroup'");  $num_rows = $result->num_rows;  printf($num_rows." ");  if ($num_rows == 1) {      printf("in if...");      while($row = $result->fetch_row()) {          printf("%s", $row[0]);      }  } 

according logic:

if ($num_rows == 1) {} 

the control go part of code if getting 1 row database. part display rows never gets executed.

this 1 should work fine:

$i = 0; while($row = $result->fetch_row()){     printf("%s", $row[$i]);     $i++; } 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -