Skip to content

Instantly share code, notes, and snippets.

@zhangguiqiang
Created June 2, 2012 15:49
Show Gist options
  • Save zhangguiqiang/2858906 to your computer and use it in GitHub Desktop.
Save zhangguiqiang/2858906 to your computer and use it in GitHub Desktop.
PHP:one_mysql_select
<?php
set_time_limit(0);
$host = "";
$user = "";
$pass = "";
$db = "";
$charset = "utf8";
$link = mysql_connect($host, $user, $pass);
mysql_select_db($db);
mysql_query("set names " . $charset);
$strSql = "";
$rs = mysql_query($strSql);
$affect_rows = mysql_affected_rows();
if ("0" == $affected_rows) {
while ($row = mysql_fetch_array($rs))
{
}
} else {
}
mysql_close($link);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment