如何以这种方式选择:
$sql_result = mysql_query("SELECT 1 FROM myTable WHERE myColumn = 'something' LIMIT 0,1");
if(is_resource($sql_result) && mysql_num_rows($sql_result) > 0 ){
// how do I select a row here?
}
就像我会这样:
$query = "SELECT * FROM myTable WHERE myColumn='something'";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$something = $row['SOMETHING'];
}