MySQL Forums
Forum List  »  PHP

php Mysql use join
Posted by: yu-hsiang su
Date: June 28, 2014 09:37PM

This sql talk me DB error.

<?php
header("Content-Type:text/html; charset=utf-8");
$db_host = "XXXXXX" ;
$db_name = "XXXXX" ;
$db_user = "XXXXXXX";
$db_password = "XXXXXX" ;

$connection=mysql_pconnect($db_host , $db_user ,$db_password ) ;
mysql_select_db($db_name);
mysql_query("SET NAMES utf8",$connection);

$sqlstr = "SELECT `city.village`, `member.account` FROM `city` JOIN `member` ON `city.localnum` = `member.localnum`";


$result = mysql_query($sqlstr) or die("DB Error");
while ($row=mysql_fetch_array($result))
{
$str.= $row['city.village']."@".$row['member.account'].";";
}
echo $str=substr($str,0, strlen($str));
?>

Options: ReplyQuote


Subject
Written By
Posted
php Mysql use join
June 28, 2014 09:37PM
June 29, 2014 02:19AM
July 08, 2014 06:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.