Skip to content

Instantly share code, notes, and snippets.

@JakSprats
Created October 4, 2010 02:23
Show Gist options
  • Save JakSprats/609169 to your computer and use it in GitHub Desktop.
Save JakSprats/609169 to your computer and use it in GitHub Desktop.
<?php
$link = mysqli_connect(
'192.168.1.115', /* The host to connect to */
'root', /* The user to connect as */
'', /* The password to use */
'test'); /* The default database to query */
mysqli_query($link, "update requests set num=num + 1 where page_id = 1");
/* Send a query to the server */
if ($result = mysqli_query($link, 'select num from requests where page_id = 1')) {
/* Fetch the results of the query */
while( $row = mysqli_fetch_assoc($result) ){
printf("requests: %d\n", $row['num']);
}
/* Destroy the result set and free the memory used for it */
mysqli_free_result($result);
}
/* Close the connection */
mysqli_close($link);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment