Solved

PHP Code Help Needed

Posted on 2011-02-25
5
266 Views
Last Modified: 2012-05-11
I need to create some tables like the code you see below...come somoeone provide the code for me to do this? Thanks
formmm.JPG
0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 34979365
can you please post the code
0
 
LVL 15

Author Comment

by:wantabe2
ID: 34979379
If I had the code for the photo I would not be posting a request for it????
0
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 250 total points
ID: 34979468
A simple html code for the table or with the styling ?

<html>
<head>
    <style type="text/css">
    td{padding: 5px;}
    </style>
</head>
<body>

<table>
<tr>
    <td>In</td>
    <td>02/25/2011</td>
    <td>&nbsp;</td>
</tr>
<tr>
    <td>In</td>
    <td>02/25/2011</td>
    <td>&nbsp;</td>
</tr>
<tr>
    <td>In</td>
    <td>02/25/2011</td>
    <td>&nbsp;</td>
</tr>
</table>

</body>
</html>

Open in new window

0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34979533
Close enough ?

<html>
<head>
    <style type="text/css">
    td{padding: 5px; text-align: center;}
    .in{background-color: #00FF02; width: 70px;}
    .odd{background-color: #eeeeee;}
    .even{background-color: #DDDDDD;}
    </style>
</head>
<body>

<table>

<?php
    for($i=0;$i<7;$i++){
        if($i%2 == 0) $bgc = "odd"; else $bgc = "even";
        echo"<tr><td class=\"in\">In</td><td class=\"".$bgc."\">02/25/2011</td><td class=\"".$bgc."\"></td></tr>";
    }
?>

</table>

</body>
</html>

Open in new window

0
 
LVL 16

Assisted Solution

by:santoshmotwani
santoshmotwani earned 250 total points
ID: 34979535
a simple php code will look like this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="stylesheet.css" type="text/css" rel="stylesheet">
</head>

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("quote", $con);

$result = mysql_query("SELECT field1 ,  date FROM table ");

echo "<table>
<tr>
<th> Field1 </th>
<th> Date </th>
</tr>";

while($row = mysql_fetch_assoc($result))
  {
  echo "<tr>";
          echo "<td>" . $row['field1'] . "</td>";
            echo "<td>" . $row['date'] . "</td>";
      
     "</tr>";
  }

echo "</table>";


mysql_close($con);
?>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question