我想在下面提到的查询中仅获取有限的行输出,请帮助
$sql12 = "SELECT group_concat(concat(firm_name, '- ',city,', ',mobile,'.') SEPARATOR ' ') as Result FROM reg_dealer WHERE pincode = '$myvalue'";
$q12 = mysql_query($sql12);
$rows12= mysql_num_rows($q12);
while($res12= mysql_fetch_array($q12))
{
$res12['Result'];
$mobile = $_GET['mobile'];
$reply_message = "Greetings. Please find the nearest Partner - ".$res12['Result']."";
答案 0 :(得分:0)
尝试此代码
$sql12 = "SELECT group_concat(concat(firm_name, '- ',city,', ',mobile,'.') SEPARATOR ' ') as result FROM (select * FROM reg_dealer WHERE pincode = '$myvalue' LIMIT 0, 3) as data";
$q12 = mysql_query($sql12);
$rows12 = mysql_num_rows($q12);
while($res12= mysql_fetch_array($q12))
{
$res12['Result'];
$mobile = $_GET['mobile'];
$reply_message = "Greetings. Please find the nearest Partner - ".$res12['Result']."";
}