Ir ao conteúdo
  • Cadastre-se

PHP Como enviar dados de uma DB para uma tabela HTML


Ir à solução Resolvido por Luiz Paulo Escobar,

Posts recomendados

Muito bom dia.

Eu estou a tentar enviar os dados da minha DB para uma tabela HTML mas ainda não consegui.Alguém me pode ajudar?
Obrigado :))

HTML:

<?php
// definições de host, database, usuário e senha
$host = "localhost";
$db   = "*****";
$user = "*****";
$pass = "*****";
// conecta ao banco de dados
$con = mysql_pconnect($host, $user, $pass) or trigger_error(mysql_error(),E_USER_ERROR);
// seleciona a base de dados em que vamos trabalhar
mysql_select_db($db, $con);
// cria a instrução SQL que vai selecionar os dados
$query = sprintf("SELECT `id`,`nome`,`website`,`email`,`serv`,`data`,`montante` FROM tb");
// executa a query
$dados = mysql_query($query, $con) or die(mysql_error());
// transforma os dados em um array
$linha = mysql_fetch_assoc($dados);
// calcula quantos dados retornaram
$total = mysql_num_rows($dados);
?>

<DOCTYPE html>
<html lang="pt">
	<head>
	<base href="../../">
		<meta charset="utf-8" />
		<title>Clientes</title>
		<meta name="description" content="Metronic admin dashboard live demo. Check out all the features of the admin panel. A large number of settings, additional services and widgets." />
		<meta name="keywords" content="Metronic, bootstrap, bootstrap 5, Angular 11, VueJs, React, Laravel, admin themes, web design, figma, web development, ree admin themes, bootstrap admin, bootstrap dashboard" />
		<link rel="canonical" href="Https://preview.keenthemes.com/metronic8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" />
		<link href="assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css" />
		<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
		<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
		<style>
			.dtif
			{
				border-radius:7%;
				border-color:#f1f1f1;
				background-color: #f1f1f1;
			}

			.ai
			{
				position:relative;
				left:30px;
			}
			
			.am
			{
				position:relative;
				left:-4.6%;
			}

			.sb
			{
				height:auto;
				width:90%;
			}

			.ss
			{
				height:6%;
				width:40%;
				position:absolute;
				right: auto;
				left: 0%;
				bottom: 0%;
				top: auto;
			}

			.dn
			{
				position:absolute;
				right: 0%;
				left: 50%;
				top: 71.5%;
				bottom: 0%;
			}

			.di
			{
				position:absolute;
				right: 0%;
				left: 58%;
				top: 71.5%;
				bottom: 0%;
			}
			
			.sd
			{
				height:7%;
				width:40%;
				position:absolute;
				right: auto;
				left: 50%;
				top: auto;
				bottom: 16.5%;
			}

			.montante
			{
				border-color: transparent;
				border-style: solid;
				border-width: 5px;
				background-color:#ededed;
				border-radius:12px;
				width:70%;
				font-size:200%;
				font-weight: bold;
			}

			#delete
			{
				border-color:transparent;
				border-radius:20px;
				background-color: #ededed;
				font-family: Tahoma;
				position:center;
				color:var(--kt-toolbar-height-tablet-and-mobile);
			}

			.dropdown
			{
				position: relative;
				display: inline-block;
			}

			.dropdown-content
			{
				display: none;
				position: absolute;
				background-color: #f9f9f9;
				min-width: 160px;
				box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
				padding: 12px 16px;
				z-index: 1;
			}

			.dropdown:hover .dropdown-content
			{
				display: block;
			}

			[type=number]::-webkit-textfield-decoration-container 
			{
				flex-direction: row-reverse
			}

			.bt
			{
				background-color: #f7f7f7;
				color: #696969 ;
				cursor: pointer;
			}

			/*input[type=number]
			{
				width: 100%;
				padding: 10px 15px;
				margin: 5px 0;
				box-sizing: border-box;
         	}*/

		</style>
	</head>
	<body id="kt_body" class="header-fixed header-tablet-and-mobile-fixed toolbar-enabled toolbar-fixed toolbar-tablet-and-mobile-fixed aside-enabled aside-fixed" style="--kt-toolbar-height:55px;--kt-toolbar-height-tablet-and-mobile:55px">

						<!--begin::Menu Lateral-->
						<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>

<div class="w3-sidebar w3-bar-block w3-card w3-animate-left" style="display:none" id="mySidebar">
  <button class="w3-bar-item w3-button w3-large"
  onclick="w3_close()">Close &times;</button>
  <a href="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers/home_page_.html" class="w3-bar-item w3-button">Home</a>
  <a href="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers/registration_page_.html" class="w3-bar-item w3-button">Listagem de Clientes</a>
</div>

<div id="main">

<div class="w3-teal">
  <button id="openNav" class="w3-button w3-teal w3-xlarge" onclick="w3_open()">&#9776;</button>
  <div class="w3-container">
  </div>
</div>
</div>

<script>
function w3_open() {
  document.getElementById("main").style.marginLeft = "25%";
  document.getElementById("mySidebar").style.width = "25%";
  document.getElementById("mySidebar").style.display = "block";
  document.getElementById("openNav").style.display = 'none';
}
function w3_close() {
  document.getElementById("main").style.marginLeft = "0%";
  document.getElementById("mySidebar").style.display = "none";
  document.getElementById("openNav").style.display = "inline-block";
}
</script>

</body>

							<!--begin::Container-->
							<div id="kt_content_container" class="container">
								<!--begin::Card-->
								<div class="card">
									<!--begin::Card header-->
									<div class="card-header border-0 pt-6">
										<!--begin::Card title-->
										<div class="card-title">
											<!--begin::Search-->
											<div class="d-flex align-items-center position-relative my-1">
												<!--begin::Svg Icon | path: icons/duotone/General/Search.svg-->
												<span class="svg-icon svg-icon-1 position-absolute ms-6">
													<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
														<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
															<rect x="0" y="0" width="24" height="24" />
															<path d="M14.2928932,16.7071068 C13.9023689,16.3165825 13.9023689,15.6834175 14.2928932,15.2928932 C14.6834175,14.9023689 15.3165825,14.9023689 15.7071068,15.2928932 L19.7071068,19.2928932 C20.0976311,19.6834175 20.0976311,20.3165825 19.7071068,20.7071068 C19.3165825,21.0976311 18.6834175,21.0976311 18.2928932,20.7071068 L14.2928932,16.7071068 Z" fill="#000000" fill-rule="nonzero" opacity="0.3" />
															<path d="M11,16 C13.7614237,16 16,13.7614237 16,11 C16,8.23857625 13.7614237,6 11,6 C8.23857625,6 6,8.23857625 6,11 C6,13.7614237 8.23857625,16 11,16 Z M11,18 C7.13400675,18 4,14.8659932 4,11 C4,7.13400675 7.13400675,4 11,4 C14.8659932,4 18,7.13400675 18,11 C18,14.8659932 14.8659932,18 11,18 Z" fill="#000000" fill-rule="nonzero" />
														</g>
													</svg>
												</span>
												<!--end::Svg Icon-->
												<input type="text" data-kt-customer-table-filter="search" class="form-control form-control-solid w-250px ps-15" placeholder="Procurar Cliente" />
											</div>
											<!--end::Search-->
										</div>
										<!--begin::Card title-->
										<!--begin::Card toolbar-->
										<div class="card-toolbar">
											<!--begin::Toolbar-->
											<div class="d-flex justify-content-end" data-kt-customer-table-toolbar="base">
												<!--begin::Filter-->
												<button type="button" class="btn btn-light-primary me-3" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
												<!--begin::Svg Icon | path: icons/duotone/Text/Filter.svg-->
												<span class="svg-icon svg-icon-2">
													<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
														<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
															<rect x="0" y="0" width="24" height="24" />
															<path d="M5,4 L19,4 C19.2761424,4 19.5,4.22385763 19.5,4.5 C19.5,4.60818511 19.4649111,4.71345191 19.4,4.8 L14,12 L14,20.190983 C14,20.4671254 13.7761424,20.690983 13.5,20.690983 C13.4223775,20.690983 13.3458209,20.6729105 13.2763932,20.6381966 L10,19 L10,12 L4.6,4.8 C4.43431458,4.5790861 4.4790861,4.26568542 4.7,4.1 C4.78654809,4.03508894 4.89181489,4 5,4 Z" fill="#000000" />
														</g>
													</svg>
												</span>
												<!--end::Svg Icon-->Filtro</button>
												<!--begin::Menu 1-->
												<div class="menu menu-sub menu-sub-dropdown w-300px w-md-325px" data-kt-menu="true">
													<!--begin::Header-->
													<div class="px-7 py-5">
														<div class="fs-4 text-dark fw-bolder">Filter Options</div>
													</div>
													<!--end::Header-->
													<!--begin::Separator-->
													<div class="separator border-gray-200"></div>
													<!--end::Separator-->
													<!--begin::Content-->
													<div class="px-7 py-5">
														<!--begin::Input group-->
														<div class="mb-10">
															<!--begin::Label-->
															<label class="form-label fs-5 fw-bold mb-3">Serviço:</label>
															<!--end::Label-->
															<!--begin::Input-->
															<select class="form-select form-select-solid fw-bolder" data-kt-select2="true" data-placeholder="Select option" data-allow-clear="true" data-kt-customer-table-filter="month">
																<option></option>
																<option value="Marketing Digital">Marketing Digital</option>
																<option value="Criação de Lojas Online">Criação de Lojas Online</option>
																<option value="Criação de Websites">Criação de Websites</option>
																<option value="Alojamento Web">Alojamento Web</option>
																<option value="Suporte Profissional">Suporte Profissional</option>
																<option value="Aplicação Mobile">Aplicação Mobile</option>
															</select>
															<!--end::Input-->
														</div>
														<!--end::Input group-->

														<!--begin::input group-->
														<div><!--gegin::date-->
															<p> <b>Data Inicial</b> </p>
															<input class="dtif" type="date" id="datai" name="datai" placeholder="00/00/0000">
															<br><br>
															<p> <b>Data Final</b> </p>
															<input class="dtif" type="date" id="dataf" name="dataf" placeholder="00/00/0000">
														</div><!--end::date-->
														<!--end::input group-->

														<!--begin::Actions-->
														<div class="d-flex justify-content-end">
															<button type="reset" class="btn btn-white btn-active-light-primary me-2" data-kt-menu-dismiss="true" data-kt-customer-table-filter="reset">Reset</button>
															<button type="submit" class="btn btn-primary" data-kt-menu-dismiss="true" data-kt-customer-table-filter="filter">Apply</button>
														</div>
														<!--end::Actions-->
													</div>
													<!--end::Content-->
												</div>
												<!--end::Menu 1-->
												<!--end::Filter-->
												<!--begin::Add customer-->
												<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#kt_modal_add_customer">
												<!--begin::Svg Icon | path: icons/duotone/Navigation/Plus.svg-->
												<span class="svg-icon svg-icon-2">
													<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
														<rect fill="#000000" x="4" y="11" width="16" height="2" rx="1" />
														<rect fill="#000000" opacity="0.5" transform="translate(12.000000, 12.000000) rotate(-270.000000) translate(-12.000000, -12.000000)" x="4" y="11" width="16" height="2" rx="1" />
													</svg>
												</span>
												<!--end::Svg Icon-->Adicionar Cliente</button>
												<!--end::Add customer-->
											</div>
											<!--end::Toolbar-->
											<!--begin::Group actions-->
											<div class="d-flex justify-content-end align-items-center d-none" data-kt-customer-table-toolbar="selected">
												<div class="fw-bolder me-5">
												<span class="me-2" data-kt-customer-table-select="selected_count"></span>Selected</div>
												<button type="button" class="btn btn-danger" data-kt-customer-table-select="delete_selected">Delete Selected</button>
											</div>
											<!--end::Group actions-->
										</div>
										<!--end::Card toolbar-->
									</div>
									<!--end::Card header-->
									<!--begin::Card body-->
									<div class="card-body pt-0">
										<!--begin::Table-->
										<table class="table align-middle table-row-dashed fs-6 gy-5" id="kt_customers_table">
											<!--begin::Table head-->
											<thead>
												<!--begin::Table row-->
												<tr class="text-start text-gray-400 fw-bolder fs-7 text-uppercase gs-0">
													<th class="w-10px pe-2">
														<div class="form-check form-check-sm form-check-custom form-check-solid me-3">
															<input class="form-check-input" type="checkbox" data-kt-check="true" data-kt-check-target="#kt_customers_table .form-check-input" value="1" />
														</div>
													</th>
													<th class="min-w-125px">id</th>
													<th class="min-w-125px">Nome</th>
													<th class="min-w-125px">Website</th>
													<th class="min-w-125px">Email</th>
													<th class="min-w-125px">Serviço</th>
													<th class="min-w-125px">Data</th>
													<th class="min-w-125px">Montante</th>
													<th class="text-end min-w-70px">Delete</th>
												</tr>
												<!--end::Table row-->
											</thead>
											<!--end::Table head-->
											<!--begin::Table body-->
											<tbody class="fw-bold text-gray-600">
												<tr>
                                                <?php
                                                    // se o número de resultados for maior que zero, mostra os dados
                                                    if($total>0)
                                                    {    // inicia o loop que vai mostrar todos os dados
                                                        do {
                                                ?>
													<td><div class="form-check form-check-sm form-check-custom form-check-solid"><input class="form-check-input" type="checkbox" value="1" /></div></td>
													<!--begin::id--><td> <?$linha['id']?> </td><!--end::id-->

													<!--begin::nome--><td> <?$linha['nome']?> </td><!--end::nome-->

													<!--begin::website--><td> <?$linha['website']?> </td><!--end::website-->

													<!--begin::e-mail--><td> <?$linha['email']?> </td><!--end::email-->

													<!--begin::Serviço--><td> <?$linha['serv']?> </td><!--end::Serviço-->

													<!--begin::Data--><td> <?$linha['data']?> </td><!--end::Data-->

													<!--begin::Montante--><td> <?$linha['montante']?> </td><!--end::Montante-->
													<!--begin::Action=-->
													<td class="text-end">
															<!--begin::Menu item-->
															<div class="menu-item px-3">
																<button id="delete" alt="delete" .class="menu-link px-3" data-kt-customer-table-filter="delete_row"><b>Delete</b></button>
														</div>
													</td>
													<!--end::Action=-->
												</tr>
											</tbody>
                                            <?php
                                                        // finaliza o loop que vai mostrar os dados
                                                        }while($linha = mysql_fetch_assoc($dados));
                                                    // fim do if
                                                    }
                                                ?>
											<!--end::Table body-->
											<?php}?>
										</table>
										<!--end::Table-->
									</div>
									<!--end::Card body-->
								</div>
								<!--end::Card-->
								<!--begin::Modals-->
								<!--begin::Modal - Customers - Add-->
								<div class="modal fade" id="kt_modal_add_customer" tabindex="-1" aria-hidden="true">
									<!--begin::Modal dialog-->
									<div class="modal-dialog modal-dialog-centered mw-650px">
										<!--begin::Modal content-->
										<div class="modal-content">
											<!--begin::Form-->
											<form class="form" method="POST" action="http://localhost/clientes/metronic_v8.0.13/html_bootstrap5/theme/demo1/dist/apps/customers/login_and_insert_.php" id="kt_modal_add_customer_form">
												<div class="ai">
												<!--begin::Modal header-->
												<div class="modal-header am" id="kt_modal_add_customer_header">
													<!--begin::Modal title-->
													<h2 class="fw-bolder">Adicionar Cliente</h2>
													<!--end::Modal title-->
												</div>
												<!--end::Modal header-->
												<br>
													<!--begin::Input group-->
													<div class="fv-row mb-7">
														<!--begin::Label-->
														<label class="fs-6 fw-bold mb-2">
															<span class="required">Nome</span>
															<img src="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers\botao-de-informacao.png" title="Tem que inserir o nome completo.">
														</label>
														<!--end::Label-->
														<!--begin::Input-->
														<input type="text" name="nome" class="form-control form-control-solid sb" placeholder="Cliente Exemplo Modelo" value=""/>
														<!--end::Input-->
													</div>
													<!--end::Input group-->
													<br>
													<!--begin::Input group-->
													<div class="fv-row mb-7">
														<!--begin::Label-->
														<label class="fs-6 fw-bold mb-2">
															<span class="required">Website</span>
															<img src="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers\botao-de-informacao.png" title="O website tem que ser válido.">
														</label>
														<!--end::Label-->
														<!--begin::Input-->
														<input type="text" name="website" class="form-control form-control-solid sb" placeholder="www.Cliente_Exemplo_Modelo.com" value="" />
														<!--end::Input-->
													</div>
													<!--end::Input group-->
													<br>
													<!--begin::Input group-->
													<div class="fv-row mb-7">
														<!--begin::Label-->
														<label class="fs-6 fw-bold mb-2">
															<span class="required">Email</span>
															<img src="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers\botao-de-informacao.png" title="O email tem de estar activo.">
														</label>
														<!--end::Label-->
														<!--begin::Input-->
														<input type="email" name="email" class="form-control form-control-solid sb" placeholder="[email protected]" value="" />
														<!--end::Input-->
													</div>
													<!--end::Input group-->
											
													<!--begin::Input group-->
													<br>
													<div class="d-flex flex-column mb-7 fv-row">
														<!--begin::Label-->
														<label class="fs-6 fw-bold mb-2">
															<span class="required">Serviço</span>
															<img src="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers\botao-de-informacao.png" title="Serviço Desejado">
														</label>
														<!--end::Label-->
														<!--begin::Input-->
														<select class="form-select form-select-solid dropdown ss" name="servico" aria-label="Selecione um Serviço" data-control="select2" data-placeholder="Selecione um serviço..." data-dropdown-parent="#kt_modal_add_customer">
															<option class="dopdown-content ss" name="servico" value="">Selecione um serviço...</option>
															<option class="dopdown-content ss" name="servico" value="Alojamento Web">Alojamento Web</option>
															<option class="dopdown-content ss" name="servico" value="Aplicação Mobile">Aplicação Mobile</option>
															<option class="dopdown-content ss" name="servico" value="Criação de Lojas Online">Criação de Lojas Online</option>
															<option class="dopdown-content ss" name="servico" value="Criação de Websites">Criação de Websites</option>
															<option class="dopdown-content ss" name="servico" value="Marketing Digital">Marketing Digital</option>
															<option class="dopdown-content ss" name="servico" value="Suporte Profissional">Suporte Profissional</option>
														</select>
														<!--end::Input-->
													</div>
											
													<!--end::Input group-->
													
													<!--begin::Input group-->
													<div class="fv-row mb-7">
														<!--begin::Label-->
														<label class="fs-6 fw-bold mb-2">
															<span class="required dn">Data</span>
															<img class="di" src="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers\botao-de-informacao.png" title="Data tem que ser actualizada.">
														</label>
														<!--end::Label-->
														<!--begin::Input-->
														<input type="date" name="data" class="form-control form-control-solid sd"  placeholder="00/00/0000" value="" />
														<!--end::Input-->
													</div>
													<!--end::Input group-->
													
													<!--begin::Input group-->
													<div class="fv-row mb-7">
														<!--begin::Label-->
														<label class="fs-6 fw-bold mb-2">
															<span class="required" style="font-size:150%">Montante</span>
															<img src="C:\xampp\htdocs\clientes\metronic_v8.0.13\html_bootstrap5\theme\demo1\dist\apps\customers\botao-de-informacao.png" title="Quantidade (0 a 999999)">
														</label>
														<!--end::Label-->
														<!--begin::Input-->
														<input type="number" id="quantity" class="montante" name="montante" min="0" max="999999" placeholder="  000000" value=""></div>
														<!--end::Input-->
													</div>
													<!--end::Input group-->
													<!--begin::Modal footer-->
													<div class="modal-footer flex-center">
														<!--begin::Button-->
														<button type="reset" id="kt_modal_add_customer_cancel" class="btn btn-white me-3">Discard</button>
														<!--end::Button-->
														<!--begin::Button-->
														<button type="submit" name="enviar" value="Enviar">
															<span class="bt">Submit</span>
															<span class="indicator-progress">Please wait...
															<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
														</button>
														<!--end::Button-->
													</div>
												<!--end::Modal footer-->
												</div>
											</form>
											<!--end::Form-->
										</div>
									</div>
								</div>
								<!--end::Modal - Customers - Add-->
								<!--end::Modal - New Card-->
								<!--end::Modals-->
							</div>
							<!--end::Container-->
						</div>
						<!--end::menu lateral-->
		<div>
		<!--begin::Javascript-->
		<!--begin::Global Javascript Bundle(used by all pages)-->
		<script src="assets/plugins/global/plugins.bundle.js"></script>
		<script src="assets/js/scripts.bundle.js"></script>
		<!--end::Global Javascript Bundle-->
		<!--begin::Page Vendors Javascript(used by this page)-->
		<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
		<!--end::Page Vendors Javascript-->
		<!--begin::Page Custom Javascript(used by this page)-->
		<script src="assets/js/custom/apps/customers/list/export.js"></script>
		<script src="assets/js/custom/apps/customers/list/list.js"></script>
		<script src="assets/js/custom/apps/customers/add.js"></script>
		<script src="assets/js/custom/widgets.js"></script>
		<script src="assets/js/custom/apps/chat/chat.js"></script>
		<script src="assets/js/custom/modals/create-app.js"></script>
		<script src="assets/js/custom/modals/upgrade-plan.js"></script>
		<!--end::Page Custom Javascript-->
		<!--end::Javascript-->
		</div>
	</body>
	<!--end::Body-->
    <?php
// tira o resultado da busca da memória
mysql_free_result($dados);
?>
    </html>

 

  • Curtir 1
Link para o comentário
Compartilhar em outros sites

  • Solução

@Joel Martins Cara, não vou ler todo esse código, se me comentar somente o código da tabela e do acesso ao banco...

Mas no geral. o que devo fazer para colocar dados do banco em uma tabela php?

 

1 - pegue os dados da tabela é claro..

<?php

// é somente um exemplo

$stmt = $d->query("SELECT FROM tabela_alunos WHERE id = 1");
$dados = $stmt->exec()->fetchAll;

//usando pdo, voce adapta do seu jeito

2 - retorne esses dados no arquivo html, no caso você está usando somente um arquivo pra tudo certo? então só pega a variável $dados e enfia dentro da tabela com a abertura e o fechamento php.

 

<!--	 Estou usando pdo porque é o que eu uso mas tome como exemplo e faça do seu jeito,
         Peguei qualquer tabela que estava no seu código sem ler para dar o exemplo... -->

<?php	foreach ($dados as $dado) { ?>

  <?php //	<?= é a mesma coisa que <?php echo ?>	

      <th class=""></th>
      <th class="nome"><?=$dado->Nome?></th>
      <th class="web"><?=$dado->Website?></th>
      <th class="email"><?=$dado->Email?></th>
      <th class="servico"><?=$dado->Servico?></th>
      <th class="data"><?=$dado->Data?></th>
      <th class="montante"><?=$dado->Montante?></th>
      <th class="seila"><?= $dado->seila?></th>

  <?php } ?>
<!--end::Table row-->

 

  • Curtir 1
Link para o comentário
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisa ser um usuário para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar agora

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

 

GRÁTIS: ebook Redes Wi-Fi – 2ª Edição

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!