I am using below code to display advanced custom field (date fields) in wordpress. I want two dates to appear like e.g 12 mar - 15 mar 2017.
I am using this code
<?php echo the_sub_field('start_date').' - '.the_sub_field('end_date'); ?>
How to do it please explain ?
Right now I am getting result like this 18/09/201722/09/2017 -
my full html code
<table style=" border-collapse: collapse; table-layout: fixed; width: 800px;">
<tbody>
<tr>
<td style="border: 1px solid #ddd;"><h5 style="color:#044970;">Refernce</h5></td>
<td style="border: 1px solid #ddd;"><h5 style="color:#044970;">Dates</h5></td>
<td style="border: 1px solid #ddd;"><h5 style="color:#044970;">Venue</h5></td>
<td style="border: 1px solid #ddd;"><h5 style="color:#044970;">Fees</h5></td>
<td style="border: 1px solid #ddd;"><h5 style="color:#044970;">CPE Credits</h5></td>
<td style="border: 1px solid #ddd;"><h5 style="color:#044970;">Regsitrations</h5></td>
</tr>
</tbody>
</table>
<table style=" border-collapse: collapse; table-layout: fixed; width: 800px;">
<tbody>
<?php
if( have_rows('sub_seminars') ):
while( have_rows('sub_seminars') ) : the_row();
?>
<tr>
<td style="border: 1px solid #ddd;"><h6><?php the_sub_field('ref'); ?></h6></td>
<td style="border: 1px solid #ddd;"><h6><?php echo the_sub_field('start_date').' - '.the_sub_field('end_date'); ?></h6></td>
<td style="border: 1px solid #ddd;"><h6><?php the_sub_field('venue'); ?></h6></td>
<td style="border: 1px solid #ddd;"><h6><?php the_sub_field('fees'); ?></h6></td>
<td style="border: 1px solid #ddd;"><h6><?php the_sub_field('cpe_credits'); ?></h6></td>
<td style="border: 1px solid #ddd;"><a href="<?php home_url(); ?>/euromatechnew/seminar-registrations?seminartitle=<?php echo htmlentities(urlencode(get_the_title())) ?>&seminarvenue=<?php echo the_sub_field('venue');
?>&seminardates=<?php echo the_sub_field('start_date').the_sub_field('end_date'); ?>&seminarref=<?php echo the_sub_field('ref') ?>" class="dt-btn" style="margin: 3px 0px 0px 0px">Register Now</a></td>
</tr>
<?php
endwhile;
endif;
?>
</tbody>
</table>
the_sub_field function already echoes data.
To get data and then echo it - use get_sub_field.
Proper code is:
<?php echo get_sub_field('start_date').' - '.get_sub_field('end_date'); ?>
Or as with your markup:
<td style="border: 1px solid #ddd;"><h6><?php the_sub_field('start_date');?> - <?php the_sub_field('end_date');?></h6></td>
To format your dates as you need you can use date fomatting functions of php, e.g date.
Related
I´m using DomPDF to generate a PDF in PHP. I need to put 2 tables side by side.
<table style=" border: 1px solid black !important;">
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">names</td>
<td style=" border: 1px solid black !important;">salary</td>
</tr>
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">Pedro</td>
<td style=" border: 1px solid black !important;">1500</td>
</tr>
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">Jhon</td>
<td style=" border: 1px solid black !important;">450</td>
</tr>
</table>
<table style=" border: 1px solid black !important;">
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">Brand</td>
<td style=" border: 1px solid black !important;">Color</td>
</tr>
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">Ferrari</td>
<td style=" border: 1px solid black !important;">Green</td>
</tr>
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">Daewoo</td>
<td style=" border: 1px solid black !important;">Blue</td>
</tr>
<tr style=" border: 1px solid black !important;">
<td style=" border: 1px solid black !important;">Chevrolet</td>
<td style=" border: 1px solid black !important;">Gray</td>
</tr>
</table>
I tried to put display:inline-block; on the tables but I've got a FatalThrowableError.
Call to a member function get_cellmap() on null
I tried to change display:inline-block to float:left but I've got something like this
They were "side by side" but just the content moved to right. Borders are wrong.
How can I put 2 tables side by side using DomPDF?.
Setting position:absolute on 2nd table and adjusting per right/left/top/bottom css did the trick for me
I have a working datatable on my site, but the initial problem was that there were so many columns and side scrolling would take away the datatable's search function, page numbers and number of entries option. I added the wrap code to my datatable JS code, seen below:
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#mytable').DataTable();
$("#mytable").wrap("<div style='overflow-x: auto' />");
});
}(jQuery));
</script>
Which makes the datatable options fixed and only sidescrolls the table content (this is what I want) but it looks like this:
So, the function works properly now but I'd like to find a way to get the table to be the full width and have the datatable options sit on top and below like it was before, rather than the table being sandwiched between the datatable options.
Here's the full table code:
<div class="dashboardTable" style="width:920px;">
<table id="mytable" style="border: 1px solid #468BBD; border-collapse: collapse; width:100%; margin:0 auto;">
<thead>
<tr style="border: 1px solid #468BBD;">
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Service Preformed</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Work Order Number</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Date</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Utility</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Service Name</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Address</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">Serial No.</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">lowSideMIUNumArriv</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">lowSideMIUNumDepart</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">highSideMIUNumArriv</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">highSideMIUNumDepart</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">locationNotes</th>
<th style="padding-left: 10px; padding-right:10px; border: 1px solid #468BBD;">locationComments</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($result1)){
?>
<tr>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['workOrderType2'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['workOrderNum'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['date'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['utility'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['serviceName'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['address'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><?php echo ''.$row['serialNumber'].''; ?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['lowSideMIUNumArriv'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['lowSideMIUNumDepart'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['highSideMIUNumArriv'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['highSideMIUNumDepart'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['locationNotes'];?> </td>
<td style="border-collapse: collapse; padding-left: 10px; padding-right:10px;"><? echo $row['locationComments'];?> </td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js">
</script>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#mytable').DataTable();
$("#mytable").wrap("<div style='overflow-x: auto' />");
});
}(jQuery));
</script>
Put your table in <div class="table-responsive"> </div> Section
I have made separate html file and using file_get_content i am using it to include it in my content part but when i recieve email html code is displayed as a text rather than what the ouptut of html file should be
<html>
<head>
</head>
<body>
<div>
<div class="popup-logo" style="width: 100px;">
<img src="logo.png" alt="jk" style="margin-left: 45%;width: 200px;height: 50px;"></div>
</div>
<div id="popup" style="width: 100%;margin-left: auto;margin-right: auto;background: #FFFFFF;-moz-box-shadow: #64686e 0px 0px 3px 3px;-webkit-box-shadow: #64686e 0px 0px 3px 3px;margin-top: 1%;">
<div class="search-col" style="border-bottom: 1px solid #e5e5e5;float: left;margin-bottom: 5px;padding: .2px;width: 100%;table, th, td {
border: .5px solid silver;border-collapse: collapse;">
<div class="select-style">
<div class="select-style-text" style="width: 100%;height: 67px;float: left;padding-left: 10px;">
<p style="color: #840107;font-family: Hind;font-size: 25px;font-weight: 600;text-align: left;margin-left: 40%;text-overflow: none;text-indent: 2em;">Dispatched Details</p>
</div>
<div class="da" style="color:green;margin-left:85%;">
<?php
$date = date('d-M-Y H:i:s');
echo "Date"." ". $date;
?>
</div>
</div>
</div>
<div>
<div id="wer">
<h3 style="padding: 0.5px;padding-left: 5px;">Order Number:<?php echo $_SESSION['id'];?></h3>
<h3 style="padding: 0.5px;padding-left: 5px;">Vendor details:</h3>
<div id="wer" style="margin-left:0%;">
<table style="width: 100%;border: 1px solid silver;border-collapse: collapse;text-align: center;">
<tr>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">VendorName</th>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">Code</th>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">Email</th>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">Contact</th>
</tr>
<tr>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['vnm']?></td>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['vcd']?></td>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['vem']?></td>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['vcn']?></td>
</tr>
</table>
</div>
<div id="wer" style="margin-top:3%;">
<h3 style="padding: 0.5px;padding-left: 5px;">Other Details:</h3>
<style>
</style>
<table style="width: 100%;border: 1px solid silver;border-collapse: collapse;text-align: center;">
<tr>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">Driver name</th>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">Driver contact </th>
<th style="border: 1px solid silver;border-collapse: collapse;text-align: center;">Vehicle Number</th>
</tr>
<tr>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['drivname']?></td>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['dcontact']?></td>
<td style="border: 1px solid silver;border-collapse: collapse;text-align: center;"><?php echo $_SESSION['vnumber']?></td>
</tr>
</table>
</div>
<?php session_destroy();?>
</div></div></div></body>
</html>
<?php
require '/sendgrid-php/vendor/autoload.php';
if(require("sendgrid-php/vendor/autoload.php"))
{echo "path found";}
$from = new SendGrid\Email(null, 'k1#gmail.com');
$subject ='Order number is';
$to = new SendGrid\Email(null, 'k2#gmail.com');
$r=file_get_contents('ret.html');
$content = new SendGrid\Content("text/plain",$r);
$mail = new SendGrid\Mail($from, $subject, $to, $content);
$apiKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$sg = new \SendGrid($apiKey);
$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode();
echo $response->headers();
echo $response->body();
?>
You have to include that file, evaluate it as PHP and capture it inside a variable instead of storing the unevaluated content in a string:
ob_start();
include("ret.html");
$r = ob_get_clean();
$content = new SendGrid\Content("text/html",$r);
By the way, you should consider using a templating engine for that job.
From what I can understand, your email is sent as plain text instead of an html. That's because you have the email type set as text/plain when creating the SendGrid object. Changing it to text/html should do it. Replace this line
$content = new SendGrid\Content("text/plain",$r);
with
$content = new SendGrid\Content("text/html",$r);
I have some link which show data on iframe with the help of temporary data from database
I am fetching this data with the help of query strings
The page with Links is
<style type="text/css">
a
{
text-decoration:none;
}
.Menu
{
width:150px;
float:left;
}
.fr
{
width:800px;
height:800px;
float:right
}
</style>
<div class="Menu">
<?php
mysql_connect("localhost","dbname","password");
mysql_select_db("dbname");
$sql="select * from NSEIndices_latest";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
$tpnt=$row['TickerPlantCode']; //nse indice code
$indexname=$row['IndexName']; //nse indice index name
?>
<tr>
<td><?php echo $indexname;?><br></td>
</tr>
<?php }?>
</div>
<div class="fr">
<iframe height="780" width="780" scrolling="no" name="fr"></iframe>
</div>
Now the link from above page fetch data with the help of query string at this page a temporary table is created by collectiong data from various tables
but am getting error while retrieve data from that temporary table
the page with temporary table is
<table class="table" cellspacing="0" width="100%">
<tr>
<td align="left" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9;">Company Name
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">High
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Low
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Last Price
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Prv Close
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Change
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">%Gain
</th>
</tr>
<?php
mysql_connect("localhost","dbname","password");
mysql_select_db("dbname");
$tpnt=$_GET['tpnt'];
$indexname=$_GET['indexname'];
echo "1".$indexname. "<br>";
$query="SELECT nsepricequotes_latest.Symbol, nsepricequotes_latest.CompanyName, nsepricequotes_latest.HighPrice, nsepricequotes_latest.LowPrice, nsepricequotes_latest.LastTradedPrice, nsepricequotes_latest.ClosePrice, nsepricequotes_latest.NetChange, nsepricequotes_latest.PercentChange, nse_index_constituents.Tickerplant_index_code,nse_index_constituents.NSE_Index_Name
FROM nsepricequotes_latest, nse_index_constituents
WHERE nsepricequotes_latest.TickerPlantCode = nse_index_constituents.TickerPlant_scrip
AND PercentChange >0
ORDER BY PercentChange DESC ";
$result=mysql_query($query);
echo "2".$indexname. "<br>";
while($row1=mysql_fetch_array($result))
{
$Symbol1=$row1['Symbol'];
$CompanyName1=$row1['CompanyName'];
$HighPrice1=$row1['HighPrice'];
$LowPrice1=$row1['LowPrice'];
$LastTradedPrice1=$row1['LastTradedPrice'];
$ClosePrice1=$row1['ClosePrice'];
$NetChange1=$row1['NetChange'];
$PercentChange1=$row1['PercentChange'];
$Tickerplant_index_code1=$row1['Tockerplant_index_code1'];
$NSE_Index_Name1=$row1['NSE_Index_Name'];
}
echo "3".$indexname. "<br>";
$tbl="create TEMPORARY TABLE temppice(Symbol varchar(100),CompanyName varchar(200),HighPrice float(50),LowPrice float(50),LastTradedPrice float(50),ClosePrice float(50),NetChange float(50),PercentChange float(50),Tickerplant_index_code varchar(100),NSe_Index_Name varchar(100))";
$res=mysql_query($tbl);
if (!$res) { die('Temporary table creation failed: ' . mysql_error()); }
if(mysql_error())die(mysql_error());
$intbl="Insert into temppice values('$Symbol1','$CompanyName1','$HighPrice1','$LowPrice1','$LastTradedPrice','$ClosePrice1','$NetChange1','$PercentChange1','$Tockerplant_index_code1','$NSE_Index_Name1')";
mysql_query($intbl);
if(mysql_error())die(mysql_error());
echo "4".$indexname. "<br>";
$query1="Select * from temppice where NSE_Index_Name=$indexname";
$result1=mysql_query($query1);
//if(mysql_error())die(mysql_error());
while($row=mysql_fetch_array($result1, MYSQL_BOTH))
{
$symbol=$row['Symbol'];
$CompanyName=$row['CompanyName'];
$HighPrice=$row['HighPrice'];
$LowPrice=$row['LowPrice'];
$previousclose=$row['LastTradedPrice'];
$ClosePrice=$row['ClosePrice'];
$netChange=$row['NetChange'];
$percentagechange=$row['PercentChange'];
?>
<tr>
<td align="left" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $CompanyName;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $HighPrice;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $LowPrice;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $previousclose; ?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $ClosePrice;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $netChange;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $percentagechange;?></td>
</tr>
<?php } ?>
</table>
the error am getting is
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mastertr/public_html/master/wpfiles/gtnsegainers.php on line 58
TEMPORARY tables have lifetime of one connection, so if you create the table during one request from the browser, and then want to fetch data from it in another request.... it's no longer there. The table does not exist and your query fails with no such table in database error.
i have a table created by my sql equijoin
and i want to retrieve data from that table by am getting error
the error is
dname.resource doesn't exist
and the code is
<style type="text/css">
a
{
text-decoration:none;
}
.Menu
{
width:150px;
float:left;
}
.fr
{
width:800px;
height:800px;
float:right
}
</style>
<div class="Menu">
<?php
mysql_connect("localhost","dbname","password");
mysql_select_db("dbanme");
$sql="select * from NSEIndices_latest";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
$tpnt=$row['TickerPlantCode']; //nse indice code
$indexname=$row['IndexName']; //nse indice index name
?>
<tr>
<td><?php echo $indexname;?><br></td>
</tr>
<?php }?>
</div>
<div class="fr">
<iframe height="780" width="780" scrolling="no" name="fr"></iframe>
</div>
the gtnsegainer.php page on am getting error is
the gtnsegainer page is in iframe
this page retrieve data from database according to the link on the above page
<table class="table" cellspacing="0" width="100%">
<tr>
<td align="left" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9;">Company Name
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">High
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Low
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Last Price
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Prv Close
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Change
</th>
<td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">%Gain
</th>
</tr>
<?php
mysql_connect("localhost","dbname","password");
mysql_select_db("dbname");
$tpnt=$_GET['tpnt'];
$indexname=$_GET['indexname'];
$query="SELECT nsepricequotes_latest.Symbol, nsepricequotes_latest.CompanyName, nsepricequotes_latest.HighPrice, nsepricequotes_latest.LowPrice, nsepricequotes_latest.LastTradedPrice, nsepricequotes_latest.ClosePrice, nsepricequotes_latest.NetChange, nsepricequotes_latest.PercentChange, nse_index_constituents.Tickerplant_index_code
FROM nsepricequotes_latest, nse_index_constituents
WHERE nsepricequotes_latest.TickerPlantCode = nse_index_constituents.TickerPlant_scrip
AND PercentChange >0
ORDER BY PercentChange DESC ";
$result=mysql_query($query);
$query1="Select * from $result where NSE_Index_Name=$indexname";
$result1=mysql_query($query1);
while($row=mysql_fetch_array($result1))
{
$symbol=$row['Symbol'];
$CompanyName=$row['CompanyName'];
$HighPrice=$row['HighPrice'];
$LowPrice=$row['LowPrice'];
$previousclose=$row['LastTradedPrice'];
$ClosePrice=$row['ClosePrice'];
$netChange=$row['NetChange'];
$percentagechange=$row['PercentChange'];
?>
<tr>
<td align="left" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $CompanyName;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $HighPrice;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $LowPrice;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $previousclose; ?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $ClosePrice;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $netChange;?></td>
<td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $percentagechange;?></td>
</tr>
<?php } ?>
</table>
it is hard to tell what your error is, in your particular setup, but i recommend adding some simple debugging as such, after each mysql_query($query); add if(mysql_error())die(mysql_error()); and that will point you in the right direction.