Jump to content

output mysql query in a table


jobs1109

Recommended Posts

Hi,

 

I am trying to get this Mysql results in a table

 

Here is the output

 

 




<table  width="500">
<tr><td><center><img border="0" src="http://www.hiringinhilo.com/Hilo-Jobs/Hilo-Logo/job-search-results-top.gif"><center><br><br></td></tr>

<tr><td>
<?php do {?>

<p><a href="http://www.hiringinhilo.com/Hilo-Jobs/Job-Search-Form/Getting-Data-From-Database/Job-Details/Job-Details.php?id=<?php echo $rsjobs['id'];?>" target="new"><?php echo $rsjobs['JobTitle']; ?></a>

<?php echo date("m/d/Y",strtotime($rsjobs['PostedOnDate'])); ?> 


<?php echo $rsjobs['State'];?>

<?php echo $rsjobs['JobType'];?>


<?php } while ($rsjobs=mysql_fetch_assoc($jobs_query)) ?>

</td></tr>
</table>
</center>




 

 

How do I get this to print out in a table like

 

Job title                  Date Posted                State                                    Job type

 

 

Thanks

Link to comment
Share on other sites

<?php do{

:wtf:

 

here, try this:

<?php
echo '<img border="0" src="http://www.hiringinhilo.com/Hilo-Jobs/Hilo-Logo/job-search-results-top.gif">';
echo '<table  width="500">';
echo'<tr><th>Job Title</th><th>Date Posted</th><th>State</th><th>Job Type</th></tr>';
while ($rsjobs=mysql_fetch_assoc($jobs_query)){
echo '<tr><td>';
echo '<td><a href="http://www.hiringinhilo.com/Hilo-Jobs/Job-Search-Form/Getting-Data-From-Database/Job-Details/Job-Details.php?id=<'.$rsjobs['id'].' target="new">'.$rsjobs['JobTitle'].'</a></td>';
$date = date("m/d/Y",strtotime($rsjobs['PostedOnDate']));
echo '<td>'.$date.'</td>';
echo '<td>'.$rsjobs['State'].'</td>';
echo '<td>'.$rsjobs['JobType'].'</td>';
echo '</tr>';
}
echo '</table>';

I have to assume you have assigned the value to $job_query outwith the code you have provided.

Link to comment
Share on other sites

Hi thanks for helping but I am getting an error message.

 

Here is the code i have now

 



<center>
<?php do{
<?php 
echo '<img border="0" src="http://www.hiringinhilo.com/Hilo-Jobs/Hilo-Logo/job-search-results-top.gif">';

echo '<table  width="500">';
echo'<tr><th>Job Title</th><th>Date Posted</th><th>State</th><th>Job Type</th></tr>';while ($rsjobs=mysql_fetch_assoc($jobs_query)){echo '<tr><td>';

echo '<td><a href="http://www.hiringinhilo.com/Hilo-Jobs/Job-Search-Form/Getting-Data-From-Database/Job-Details/Job-Details.php?id=<'.$rsjobs['id'].' target="new">'.$rsjobs['JobTitle'].'</a></td>';$date = date("m/d/Y",strtotime($rsjobs['PostedOnDate']));
echo '<td>'.$date.'</td>';

echo '<td>'.$rsjobs['State'].'</td>';

echo '<td>'.$rsjobs['JobType'].'</td>';echo '</tr>';}echo '</table>';

} ?>


</center>



 

 

and here is the error message

 

 

 

Parse error: syntax error, unexpected '<' in /home/content/h/i/l/hilo103/html/Hilo-Jobs/Job-Search-Form/Getting-Data-From-Database/Getting-Data-Database4.php on line 51

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.