www.webdeveloper.com
Results 1 to 7 of 7

Thread: how to visualize datda from mysql database using PHP

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Posts
    15

    how to visualize datda from mysql database using PHP

    Hi,

    i have stored data into database ,how can i visualize data from mysql database using PHP, would be grateful for your help

  2. #2
    Join Date
    Oct 2012
    Posts
    13
    What you mean by visualization ? Graphic charts or what ?

  3. #3
    Join Date
    Oct 2012
    Posts
    15
    thanks for your reply, i don't mean to charts, i mean , i have a database with several tables, for example, one table has several picture from different product, one table has several video link of the product, one table has the pdf link, i would like to know how can i show in the web page all the data from database by user clicking , for example , there is a button called "video" if one click on it then , it will show the video from database, another button called "pdf" if one click on "pdf" button then it will show the correcponding pdf file from database(as inside database alreda)

  4. #4
    Join Date
    Oct 2012
    Posts
    13
    I think it is not good idea to store pictures in database, better would be to store just a photo names. However, you have to do it similar to that:

    PHP Code:

    if(isset($_POST['button_pic'])){

    $query=mysql_query("SELECT `pic_link` FROM pic_table");
    while(
    $row=mysql_fetch_array($query)){
    echo
    '<img src="'.$row.'" />';
    }

    }elseif(isset(
    $_POST['button_video'])){

    $query=mysql_query("SELECT `vid_link` FROM vid_table");
    // and so on, depend of which button was submited 
    It is the simplest way to do that. If I will find more time I can show you how exactly do that.
    And do you want to have just links to video and pdf files or just straight show them on the page ?

  5. #5
    Join Date
    Oct 2012
    Posts
    15
    thank you so much, actually i need it for a course and i just informed it that i have to do that using PHP and JQuery , therefore i would like to ask you once again, could you please give me an idea, how to use Jquery in this case?

    again, i did a mistakes, actually i didn't save photos into database , i have stored link of image, link of pdf, and link of video(for example www.hbvhvb/jpg, www.hbvhvb/mp4, www.hbvhvb/pdf) and now i have to show them by clicking on button

    i think this time i have give you clear information about what i want to do, would be happy if you give me some suggestion like before (using JQuery and PHP)

  6. #6
    Join Date
    Oct 2012
    Posts
    13
    It is all depend of what result you want to get. For example you can get data from database by PHP and then show 10 results on the page and make a button like: show more, after click on that user will see all results. It could be better if you would use PHP aswell for that, but as you have to use jQuery than I think it is not a bad idea
    But in that case you will have change a little bit a PHP script in this place:
    PHP Code:
    while($row=mysql_fetch_array($query)){
    echo
    '<img src="'.$row.'" />';

    I will let it for you to think how to do that. If you would have any trouble than ask, but it think you'll be fine with that

  7. #7
    Join Date
    Oct 2012
    Posts
    15
    Hi,
    thanks a lot for your support, actually i am very new in PHP . i tried by using your code but i am not succeed could you please give me a favor of you. for example , i have a database name= db_image; one table name=image; table has 3 colmn: id, name and path (id =1. name = picture. path = www.fvjfnjf.com)
    and the button name is: "pic"(which will be clicked to view the image)
    now could you please write to me the code according to my information, i will be so grateful to you, i am sorry for such a request and even i don't know is it polite or not but i need this help and i found you a nice and helpful person , would be grateful for your kind help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles