Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 241 characters in body; edited tags
Source Link
GMB
  • 223.8k
  • 25
  • 103
  • 151

I want to have result of my query as it was before I replaced db connection using PDO. How can I get the query as i t was before I implemented PDO?

This is my query:

$query = "SELECT    "SELECT    `id_affirmation`,   `affirmation`,   `author`,   `user_rate`,   am.date,   am.time,   hua.date,   hua.time   FROM `affirmation_male` am   JOIN `history_user_affirmation` hua  ON am.id_affirmation = huaua.affirmation_id   WHERE hua.user_id = '" . $id_user . "'   ORDER BY   STR_TO_DATE(hua.date, '%d-%m-%Y') DESC,   hua.time DESC"; 

For some reason the result of query when I use PDO is i got datedate from affirmation_maleaffirmation_male. Do you know why?

I want to have result of my query as it was before I replaced db connection using PDO. How can I get the query as i t was before I implemented PDO?

This is my query:

$query = "SELECT    `id_affirmation`,   `affirmation`,   `author`,   `user_rate`,   am.date,   am.time,   hua.date,   hua.time   FROM `affirmation_male` am   JOIN `history_user_affirmation` hua  ON am.id_affirmation = hua.affirmation_id   WHERE hua.user_id = '" . $id_user . "'   ORDER BY   STR_TO_DATE(hua.date, '%d-%m-%Y') DESC,   hua.time DESC"; 

For some reason the result of query when I use PDO is i got date from affirmation_male. Do you know why?

I want to have result of my query as it was before I replaced db connection using PDO. How can I get the query as i t was before I implemented PDO?

This is my query:

$query = "SELECT    `id_affirmation`, `affirmation`, `author`, `user_rate`, am.date, am.time, hua.date, hua.time FROM `affirmation_male` am JOIN `history_user_affirmation` hua ON am.id_affirmation = ua.affirmation_id WHERE hua.user_id = '" . $id_user . "' ORDER BY STR_TO_DATE(hua.date, '%d-%m-%Y') DESC, hua.time DESC"; 

For some reason the result of query when I use PDO is i got date from affirmation_male. Do you know why?

Source Link

PDO changes query

I want to have result of my query as it was before I replaced db connection using PDO. How can I get the query as i t was before I implemented PDO?

This is my query:

$query = "SELECT `id_affirmation`, `affirmation`, `author`, `user_rate`, am.date, am.time, hua.date, hua.time FROM `affirmation_male` am JOIN `history_user_affirmation` hua ON am.id_affirmation = hua.affirmation_id WHERE hua.user_id = '" . $id_user . "' ORDER BY STR_TO_DATE(hua.date, '%d-%m-%Y') DESC, hua.time DESC"; 

For some reason the result of query when I use PDO is i got date from affirmation_male. Do you know why?