473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to display foreach values to tables formate or datables?

aveeva
33
My foreach values like,



code :

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. session_start();
  4.  
  5. foreach($_SESSION['playlist'] as $key=>$value)
  6. {
  7.     echo $key.' '.$value.'<pre>';
  8. }
  9.  
  10. ?>
  11.  
How to display like,
Expand|Select|Wrap|Line Numbers
  1. ________________
  2. |Id   |  Title |
  3. ______|________|   
  4. |.    |    .   |
  5. |.    |    .   |
  6. |.    |    .   |
  7. |.    |    .   | 
  8. |.    |    .   |
  9. ______|________|
Jul 11 '19 #1
3 1235
gits
5,390 Expert Mod 4TB
what about a html-table?
Jul 12 '19 #2
aveeva
33
@gits Inside the PHP how can i add HTML Table?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. session_start();
  4.  
  5. foreach($_SESSION['playlist'] as $key=>$value)
  6.     {
  7.     echo $key.' '.$value.'<pre>';
  8. }
  9. ?>
  10.  
FYI : Here $key is Id & $value is Title

output :

https://snag.gy/PHmLKh.jpg
Jul 12 '19 #3
gits
5,390 Expert Mod 4TB
html is nothing more then a string - at the moment you echo plain values - add tags to them as strings and see how it behaves. this is really basic

PS: you already doing it with a <pre> tag
Jul 12 '19 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: eddie wang | last post by:
The following shows one value per row. How to display multiple values with a space seperator per row? Thanks. <td wrap width="371">Fields:</td> <% if not rs.EOF then do while not rs.EOF...
6
by: Tim Whelan via DotNetMonster.com | last post by:
Hi I am developing an asp.net web application using c# and having trouble trying to display integer values, that I have taken from the database, correctly on my webform textboxes. The values are...
3
by: Miguel Dias Moura | last post by:
Hello, I am working in ASP.NET/VB and I need to see a string value. Howe can I display the string values and also only one of the values? Thanks, Miguel
1
by: Olaf Rabbachin | last post by:
Hi folks, I have a table in an Access-DB that has a date-field (date + time). I'd like to use a DataSet + DataGrid to achieve a grouped/hierarchical display where the user would work his/her way...
4
by: dennis.joseph | last post by:
Hello Everyone, I have scoured through a million messages (ok...thats a bit exaggerated) but I just cannot figure out how to display null values in a query. I have tried Nz, IIF, Count(*) but it...
11
by: Birky | last post by:
I have an issue where I can’t figure out how to open a form where all the objects within are nulled out until a user selects an appropriate Project Name. My form has several objects (12) within which...
1
reddyprasanth
by: reddyprasanth | last post by:
Can anyone help me in writing a qurery in analyzer to display only user tables. i used sp_tables .But it displays all the tables including system tables.
7
by: Surag | last post by:
Hello Guys, I have a datbase with userid,username and password. I Need to display database values in textboxes say for eg(Name and password) and redirect to login page based on the UserID please...
5
by: neosilitone | last post by:
Hello All, Is there a way to display multiple values of a field per unique item horizontally? Current Table (as per attached): ITEM PO DATE PO QTY AAA 1/1/2014 10 AAA 2/1/2014 10...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.