Skip to content

Instantly share code, notes, and snippets.

@gaga5lala
Created October 16, 2014 03:17
Show Gist options
  • Save gaga5lala/a0e7c5e40bad5513a4ec to your computer and use it in GitHub Desktop.
Save gaga5lala/a0e7c5e40bad5513a4ec to your computer and use it in GitHub Desktop.
$sql = "SELECT * FROM `member` as m LEFT JOIN `play` as r on m.mId = r.mId where m.mDoctor = ?";
$sth=$dbh->prepare($sql);
$sth->execute(array($mId));
while ($result = $sth->fetch(PDO::FETCH_OBJ)) {
print_r($result);
}
-----
stdClass Object ( [mId] => [mAccount] => yihanlin [mPasswd] => 098f6bcd4621d373cade4e832627b4f6 [mLastName] => Yi Han [mFirstName] => Lin [mSex] => female [mDescription] => test [mHeight] => 170.5 [mWeight] => 95 [mBirthDay] => 1992-01-01 [mType] => patient [mDoctor] => 1 [lnTime] => [gId] => [pTime] => ) stdClass Object ( [mId] => [mAccount] => ggininder [mPasswd] => ggininder [mLastName] => ininder [mFirstName] => gg [mSex] => male [mDescription] => none [mHeight] => 178 [mWeight] => 99 [mBirthDay] => 1993-01-12 [mType] => patient [mDoctor] => 1 [lnTime] => [gId] => [pTime] => ) stdClass Object ( [mId] => [mAccount] => ggininder [mPasswd] => ggininder [mLastName] => ininder [mFirstName] => gg [mSex] => male [mDescription] => none [mHeight] => 178 [mWeight] => 99 [mBirthDay] => 1993-01-12 [mType] => patient [mDoctor] => 1 [lnTime] => [gId] => [pTime] => ) stdClass Object ( [mId] => [mAccount] => ggininder [mPasswd] => ggininder [mLastName] => ininder [mFirstName] => gg [mSex] => male [mDescription] => none [mHeight] => 178 [mWeight] => 99 [mBirthDay] => 1993-01-12 [mType] => patient [mDoctor] => 1 [lnTime] => [gId] => [pTime] => )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment