$link = new PDO("mysql:host=localhost;dbname=fashion",'root','');
$stmt=$link->prepare("select * from stylestatement where id='".$_REQUEST["you"]."'");
if ($stmt->execute(array($_GET['title']))) {
$row=$stmt->fetch();
$newstmt=$link->prepare("select * from images where `statementid`='".$_REQUEST["you"]."' and `added_on`='".$row["created_on"]."'");
$newstmt->execute();
echo($newstmt->rowCount());
}
在上面的代碼中,即使我在圖像表中具有相同的日期時間,我得到結果= 0,爲什麼?匹配日期時間不顯示結果
如果該字段爲datetime,確保它匹配非常秒的時間。如果偶數秒有差異,則不匹配。 –
它是同一先生,這就是爲什麼我問這個問題 – user2889070
刪除和條件,並嘗試在查詢... – user2092317