Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

iqbalmalik89
Copy link
Contributor

Conversion from mysql to PDO because mysql is deprecated.

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);
Copy link
Member

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

Copy link
Contributor Author

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.

@wouterj
Copy link
Member

wouterj commented Dec 18, 2015

I like updating this to not use mysql. Can you please fix the whitespace issues?

@iqbalmalik89
Copy link
Contributor Author

Yes, I am working on it.

@wouterj
Copy link
Member

wouterj commented Dec 19, 2015

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.

@iqbalmalik89
Copy link
Contributor Author

Alright. It's my first PR. So what's the next step?

@wouterj
Copy link
Member

wouterj commented Dec 21, 2015

@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);
Copy link
Member

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.

@javiereguiluz
Copy link
Member

👍 this change is in fact an urgent necessity now that mysql is deprecated/dead.

@iqbalmalik89 thanks for taking care of this and for this nice pull request.

wouterj added a commit that referenced this pull request Dec 21, 2015
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #5811).

Discussion
----------

Conversion from mysql to PDO

Conversion from mysql to PDO because mysql is deprecated.

Commits
-------

2b41865 Conversion from mysql to PDO
@wouterj
Copy link
Member

wouterj commented Dec 21, 2015

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! 🎄

@wouterj wouterj closed this Dec 21, 2015
<?php
mysql_close($link);
$link = null;
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants