-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion from mysql to PDO #5811
Conversation
Conversion from mysql to PDO because mysql is deprecated.
$row = mysql_fetch_assoc($result); | ||
|
||
$result = $link->query('SELECT created_at, title, body FROM post WHERE id = '.$id); | ||
$row = $result->fetch(PDO::FETCH_ASSOC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like a wrong indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will fix all these corrections today. Thanks for checking.
I like updating this to not use mysql. Can you please fix the whitespace issues? |
Yes, I am working on it. |
As you can see in the diff of this PR, there are still some whitespace issues. Anyway, we can also fix these while merging the PR, so I'm 👍 for this PR. |
Alright. It's my first PR. So what's the next step? |
@iqbalmalik89 now this PR can be considered finished, the doc team (@weaverryan, @xabbuh, @javiereguiluz and me) can vote on the PR. After at least 2 team members voted +1 (you have mine already), the PR will be merged. So unfortunately for you, it'll be a waiting game now. |
$query = 'SELECT created_at, title, body FROM post WHERE id = '.$id; | ||
$result = mysql_query($query); | ||
$row = mysql_fetch_assoc($result); | ||
$result = $link->query('SELECT created_at, title, body FROM post WHERE id = '.$id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line looks wrongly indented. It should contain one additional white space. Same for the below line.
👍 this change is in fact an urgent necessity now that @iqbalmalik89 thanks for taking care of this and for this nice pull request. |
Turns out you didn't have to wait too long :) I've merged this PR into the 2.3 version of the docs. I've fixed the indentation (seems like you used some tabs) and done a some other minor fixes which are not related to this PR in 9960f9c. Thank you for creating this great PR, @iqbalmalik89! 🎄 |
<?php | ||
mysql_close($link); | ||
$link = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should close the cursor here to be equivalent
Conversion from mysql to PDO because mysql is deprecated.