php - How to loop through elements (one field) in the mySQL table -


How to access the first element in the last element of the column and how to write a PHP code to output another PHP function is .

  & lt ;? Php $ mysqli = new mysqli ("localhost", "root", "", "whit"); / * Check connection * / if (mysqli_connect_errno ()) {printf ("Connect failed:% s \ n", mysqli_connect_error ()); Go out(); } $ Query = "Select Website From Websites"; If ($ result = $ mysqli- & gt; query ($ query)) // // To pass the PHP code to the first element till the last element of the column website and pass the output to another PHP function} / * free Result set * / $ result-> near (); } / * Close connections * / $ mysqli- & gt; Close (); ? & Gt;  

read the php manual:

  while ($ Line = $ result-> gt; fetch_assoc ()) {your_function ($ line ["website"]); }  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -