php - Display MYSQL results in html table -


I'm not sure that before a similar question has been asked, but here goes anyway. (I did a search and did not find anything related to my question.)

I am developing a website that runs videos using HTMLMedia Video Player. I have a "clock" page in my database, which draws all the correct data using the variable connected to the ID (watch.php? V = 1). I want to see an index page where the most recent videos are drawn. Those columns are ordered by "id" and when I try a result from the query and everything works. How would I go about many values? Here is my PHP code (server details are hidden):

    

and here is my HTML code for the table.

   & lt; tr & gt; & lt; td & gt; & lt; h2 & Gt; & lt;? Echo $ video ['title'];? & Gt; & lt; / h2 & gt; & lt; / td & gt; & lt; / tr & gt; & lt; / table & gt;   

This is not a complete code, But once I know the process, where can I apply it!

I am quite new to PHP and mysql. I can connect to the database, but it's completely about this It is true that what would be good!

Many thanks,

James Wassell

You can mysqli_fetch_array ($ result, MYSQLI_ASSOC) :

  & lt; Table & gt; & Lt ;? php $ mysqli = new mysqli ("HIDDEN", ​​"HIDDEN", ​​"HIDDEN", ​​"HIDDEN"); $ Sql ​​= "SELECT id, title, imgsrc, video description by video command through DDAC limit 2"; $ Result = $ mysqli- & gt; Query ($ sql); While ($ video = mysqli_fetch_array ($ result, MYSQLI_ASSOC)) {? & Gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; H2 and gt; & Lt;? Echo $ video ['title']; ? & Gt; & Lt; / H2 & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt ;? Php} mysqli_close ($ mysqli); ? & Gt; & Lt; / Table & gt;   

Note that you should consider error statements, zero controls, etc.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -