/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@b073rOct 24.2012 — What you mean by visualization ? Graphic charts or what ?
Copy linkTweet thisAlerts:
@asianhbauthorOct 24.2012 — 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)
Copy linkTweet thisAlerts:
@b073rOct 24.2012 — 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:

[code=php]

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
[/code]


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 ?
Copy linkTweet thisAlerts:
@asianhbauthorOct 25.2012 — 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)
Copy linkTweet thisAlerts:
@b073rOct 25.2012 — 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:
[code=php]
while($row=mysql_fetch_array($query)){
echo'<img src="'.$row.'" />';
}
[/code]


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 ?
Copy linkTweet thisAlerts:
@asianhbauthorOct 26.2012 — 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
×

Success!

Help @asianhb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...