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
Post a Comment