Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 153 Vote(s) - 3.69 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic PDO Retrieving Data

#1
I'm here today with a tutorial on Inserting and Retrieving Data with PDO. I wanted to stick with just basic SQL until I figured out by a friend how much easier and better PDO is. I recommend everyone try and switch over too it.

Alright, lets get started. Go to PhpMyAdmin and lets make a new table called 'People' with 3 columns. Here is the set up:

[Image: hwpCTYh.png]

Next, lets add one item. Click insert, and leave the ID field blank. Enter in a first name and a last name and click go. You should see something like this when you click Browse now:

[Image: WuncEVn.png]



We are now on the PHP portion of this! Create a new file, and call it whatever you want.

Under the "<?php" you will want to add this and fill it in with your database info where it says change me!


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Once you have done that, we will go ahead and create our query. Its very simple, and it will grab all the rows within the column we are selecting from.


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


That will execute the query, next we have to grab each row of info which can be done like so:


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


That is it for this tutorial! Next tutorial will be selecting by a parameter and binding. If you did this right then you should see something like this:

[Image: nceb.png]
Reply

#2
This is ace needed to update one of my projects from sqli to pdo. Thanks alot
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through