Search the Community
Showing results for tags 'mysql php functions'.
-
How can I change this into a function and include the file and call the function I assumed it would be something similar to this but I guess I was wrong. I was hoping for some ideas thanks funtion function_name($id){ $qv2='SELECT * FROM coaches WHERE sport_id = $id'; $rv2 = mysqli_query($dbc, $qv2); if(mysqli_num_rows($rv2) > 0){ while($row = mysqli_fetch_array($rv2, MYSQLI_ASSOC)) { $title = $row['title']; if($title == 'Head Coach'){ echo'<p align="left" style="font-family: Verdana, Geneva, sans-serif; font-size: 10pt; text-align: center;"> ' ; echo $row['coach_name'] . ' ' . $row['title']; echo "\n<br />\n"; echo '<a href="mailto:' . $row['coach_email'] . ' ">' . $row['coach_email'] . '</a>'; echo "\n<br />\n"; echo "<br />\n"; //echo "\n</p>"; } if ($title != 'Head Coach'){ echo $row['coach_name'] . ' - ' . $row['title']; echo '<br />'; } } echo'</p>'; }else{echo 'nothing here to see';} }