while($row = $result->fetch_object()) printf("<tr>
 <td align="center">%s</td><td>%d</td>
</tr>
", $row->Name, $row->Population); ?> </tbody </table> <? # ...and verify the number of rows that were retrieved printf("<p>Affected rows: %d</p>
", $link->affected_rows); } else # otherwise, tell us what went wrong echo mysqli_error(); # free the result set and the mysqli connection object $result->close(); $link->close(); ?> </body> </html> 

We assume that the process running on the Web server can reach the IP address of the SQL node. 

In a similar fashion, you can use the MySQL C API, Perl-DBI, Python-mysql, or MySQL Connectors to perform the tasks of data definition and manipulation just as you would normally with MySQL. 

## 23.2.6 Safe Shutdown and Restart of NDB Cluster 

To shut down the cluster, enter the following command in a shell on the machine hosting the management node: 

shell> ndb_mgm -e shutdown 

The -e  option here is used to pass a command to the ndb_mgm  client from the shell. The command causes the ndb_mgm , ndb_mgmd , and any ndbd  or ndbmtd  processes to terminate gracefully. Any SQL nodes can be terminated using mysqladmin shutdown  and other means. On Windows platforms, assuming that you have installed the SQL node as a Windows service, you can use SC STOP service_name  or NET STOP service_name . 

To restart the cluster on Unix platforms, run these commands: 

•On the management host ( 198.51.100.10  in our example setup): 

shell> ndb_mgmd -f /var/lib/mysql-cluster/config.ini 

•On each of the data node hosts ( 198.51.100.30  and 198.51.100.40 ): 

shell> ndbd 

•Use the ndb_mgm  client to verify that both data nodes have started successfully. 

•On the SQL host ( 198.51.100.20 ): 

shell> mysqld_safe & 

On Windows platforms, assuming that you have installed all NDB Cluster processes as Windows services using the default service names (see Section 23.2.2.4, “Installing NDB Cluster Processes as Windows Services” ), you can restart the cluster as follows: 

•On the management host ( 198.51.100.10  in our example setup), execute the following command: 

