Use PHP to Retrieve MySQL Data

Posted by: Admin  :  Category: Php

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Display the data in a MySQL database table in a web page using PHP.

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

25 Responses to “Use PHP to Retrieve MySQL Data”

  1. mastersuv Says:

    So, that query will always take all the data and put it into an array? No exception?

  2. angelbacs Says:

    Hello Sir, What if i would like to retrieve the image from the database? i think the type is blog.it is the same process?plss help me…

    from~gel_marc@yahoo.com

  3. batangyagit20 Says:

    man i love you very much 😀 now i know how to connect to an online database!

  4. 15Master1 Says:

    If im logged in (using sessions to log in) as admin, how do i get the data ONLY for admin. And i need to place the data in diffirent places (for example, id at the top at the page and name at the bottom). Help? :S

  5. samiwistler Says:

    PHP gurus

  6. titanicmusic14 Says:

    You probably already know this but … YOU ARE THE MAN!!!!!!!! thanks for your help!

  7. mmelson350 Says:

    When i dump data on my site, I need those “enum” values to repersent what they stand for. Dumping them just prints what is in the fields. Like a “Male” = “0” and “Female” = “1”. To make my website display what the values mean. Maybe someone can point me in the right direction.

  8. aramkurdi Says:

    hi, thank you for your time and effert for creating these tutorials, can you make one tutorial of (how to querry the database from web using php, ie make the query from user input, rather than saying select * ,,, just put and id and then retrive the entire row that have connection with that row.
    your time and effort appreciated very much. aram1918@yahoo.co.uk

  9. anayfp Says:

    Many Thanks, great Job!.

  10. ncbookz Says:

    @dashbyictfd i agree it worked perfect on my code and i looked at another site and the code was using loops like crazy this was a lot easier code very short ans sweet

  11. ncbookz Says:

    @TheyCallmeSR if your forum uses a database then it will work this worked perfect for me he did a great job it is perfectemente

  12. ncbookz Says:

    thank you sir i will be glad to add money to a paypal email for this help, i have my own server and php my admin but i needed to display sku on a web page for my helper to have fast access very good help! i will formulate a question later on help in another issue

  13. dashbyictfd Says:

    In mysql the date format is in yyyy/mm/dd , is there a way to manipulate this so that when it displays on your page with the rest of the retrieved data that it can be dd/mm/yy ?

  14. dashbyictfd Says:

    This was the first tutorial on this that I had followed that was

    a) complete

    and

    b) I got working

    great thanks.

  15. betaalpha987 Says:

    I’ve tried and failed working with several php/MYSQL tutorials but this one works great! Can see the text clearly and the steps are clear and simple. Top stuff!

  16. TheyCallmeSR Says:

    I have been following your tut and i’m trying to imply it to my coding. Pretty much im trying to do the same thing. i want to retrieve data from my forum that i made onto my site but its not working. do u have msn or an email so i can explain it more in detail? its probably an easy fix.

  17. WayneWexford Says:

    Firstly. Very well done tutorial. Wish I had found something like this when I was starting off. =(

    Just a small note.

    Using mysql_fetch_array is unnecessary as it returns both the name of the db column AND it’s index number. There’s no point in returning both when you’re only going to be using one. I’ve never been in a situation where I needed anything more than the associative name.

    So instead, just use:

    while($row = mysql_fetch_assoc($result)){
    //etc

    I’d be willing to be that it’s faster

  18. WeedingWaimbow Says:

    What keyboard are you using?

  19. duubamg Says:

    He’s got a beautiful accent. Which region people sound like this?

  20. HxNxIxC Says:

    YOU SOUND LIKE MARK ZUCKERBERG

  21. timboiscool Says:

    what is the link

  22. Petterss22 Says:

    Yes, sure.
    But I hate the uploading limit.

  23. littleweb1 Says:

    hey if your pretty good at it could you make a video on how to put a username and pass on a site?

  24. Petterss22 Says:

    Great tutorial dude 🙂
    Though I’m a Pro on PHP but I love your videos, you explain good.
    Very good for newbies.

  25. 23528 Says:

    good one..hope you can post more of these!

Leave a Reply

*