Created
October 4, 2010 02:23
-
-
Save JakSprats/609169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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