?
Solved

PHP Code Help Needed

Posted on 2011-02-25
5
Medium Priority
?
275 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 1000 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Suggested Courses

649 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