$sql = "SELECT *
FROM `likes`
WHERE `pid` = $pid";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$likers = array();
while($row = $result->fetch_assoc()) {
$likers[] = $row['uid'];
echo implode(", ", $likers);
}
} else {
return "Be the first to like this status...";
}
Run Code Online (Sandbox Code Playgroud)
例如,它应该显示如果查询在3行结果与用户ID下面:21,20,44
它应显示:21,20,44 但它显示:2121,20,44 看它如何显示第一个值?
另一个例子:50,60,70 但显示:5050,60,70
有什么方法可以解决?提前致谢
我最近尝试将Firebase添加到我的应用程序中.使用Cocoapods我做了一个
pod init
Run Code Online (Sandbox Code Playgroud)
和a
pod install
Run Code Online (Sandbox Code Playgroud)
这是我的Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'A' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for A
pod ‘Firebase’
end
Run Code Online (Sandbox Code Playgroud)
在尝试构建我的应用程序时,我收到以下错误:
Apple Mach-O链接器错误组
Ld /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator/A.app/A normal x86_64 cd/Users/jordanfrancis/Desktop/A export IPHONEOS_DEPLOYMENT_TARGET = 10.2 export PATH =" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin: /斌:/ usr/sbin目录:/ sbin目录" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64的-isysroot /Applications/Xcode.app/Contents/Developer/Platforms /iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator -F/Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator -F/Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac -F/Users/jordanfrancis/Desktop/A/Pods/FirebaseAnalytics/Frameworks/frameworks …