Author Options:

How to display single data values from a MySQL table with PHP? Answered

I am currently making a video website using MySQL databases and PHP. The info about the videos is stored in a table:

ID / filename / size / title / description / uploader / date / length / rating / category / image / views

I have several places where I want to display the data from the table, but only the specific data concerning the corresponding video and only from specific cells in specific places. For example on the page displaying the video, I want to have the video title over the video and the description under it (similar to YouTube). Or for example a search function, where the user searches for a video based on Title/Descriptio, but all the Info gets displayed, but in a certain form.
I do not really know PHP, but I learn as I go. Unfortunately I have not found any tutorials showing how this can be made, neither any finished examples. I have found exapmles of search scripts, but they only show the position of the row in the table. And examples that display a certain row, display the whole row, but not certain cells. I need the separate cells and want to be able to position them freely.
Thanks in advance, you can post links with tutorials or ready examples if you have any.



8 years ago

Have you tried the W3 Tutorials on PHP? It might take a few hours, but read all of it, as I would *not* recommend learning as you go. Learning it all at once, even thoroughly skimming it, and going back for reference until you get used to it will probably the best way to master your scripting skills.


(Notice that there's a section on MySQL)

On a somewhat related note, I recently saw a class in my high school handbook for next year called, "HTML Programming."



8 years ago

So you know how to write the SELECT statement ?