How to select specific Value in row from fetch_assoc () used to get a variable..? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to select specific Value in row from fetch_assoc () used to get a variable..?

 while ($row = mysqli_fetch_assoc($result)) {         printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);     } how to I select $row[name] variable first value only..

20th Feb 2019, 5:33 PM
Ashok K
Ashok K - avatar
1 Answer
+ 4
Do you mean you only want to print `$row['Name']` but not `$row['CountryCode']` ? Perhaps you can try this: printf("%s\n", $row['Name']); But if you output into HTML document you might opt to using <br /> instead of '\n' on the format specifier there. P.S. You should have tagged PHP.
20th Feb 2019, 6:06 PM
Ipang