Created
April 18, 2011 04:12
-
-
Save saturngod/924800 to your computer and use it in GitHub Desktop.
php apc with sql
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 | |
$sql="select * from `prize`"; | |
if (apc_exists($sql)) { | |
print_r( apc_fetch($sql) ); | |
} | |
else { | |
$result=mysql_query($sql); | |
while ($row = mysql_fetch_assoc($user_result)) { | |
$data[]=$row; // or you can make some process | |
} | |
//print the result | |
print_r($data); | |
apc_store($sql,$data,86400);//will expire in 86400 seconds | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment