* Ultra Newbie Question Part 2 *

From: Julia Briggs (julia4_me_at_yahoo.com)
Date: 11/28/03


Date: 27 Nov 2003 17:56:31 -0800

This is sort of a combination of the last two people who helped me, I
am still not able to get it to print to the screen -- it must be
something simple and fairly obvious. I am getting much better at
this! I am warning everyone, I may have a few other obvious questions
after this :(), but I catch on quick! My goal is to have something
very flexible that I can partiton queried results into seperate HTML
blocks with all the graphic goodies wrapped around it.

Seperately.. OK *this* question maybe is coming a little too soon, but
it has been hanging in my head - let's say I have another data column
"data_five" that will only have data 'flags' 1 or 0 present in that
column, and if a 1 is present it will print "Something", and if a 0 is
there "Something Else" on the screen when that particular field is
queried. How would that implement into the mix here?

Thanks everyone!

Kindest regards,

Julia Briggs

<?PHP

$username="xxx";
$password="xxx";
$db= mysql_connect(localhost,$username,$password);
$dbname="mydatabase";
mysql_select_db($dbname,$db);

$sql_query="SELECT * FROM mytable LIMIT 0, 30";
$result_cat = mysql_query($sql_query,$db); // load category table
$myrow_cat = mysql_fetch_array($result_cat);

printf("<table>");
do
{
 printf("<tr>");
 printf("<td>%s</td><td>%s</td><td>%s</td><td>%s</td>",$data_one,$data_two,$data_three,$data_four);
 printf("</tr>");
}
while($myrow_cat = mysql_fetch_array($result_cat));
printf("</table>");

mysql_close();
?>

DATABASE NAME: "mydatabase"
TABLE NAME: "mytable"

> +-------------+-------------+-------------+-------------+
> | data_one | data_two | data_three | data_four |
> | Something1 | Something2 | Something3 | 2004-02-04 |
> | Something1 | Something2 | Something3 | 2004-03-17 |
> | Something1 | Something2 | Something3 | 2004-05-13 |
> | Something1 | Something2 | Something3 | 2004-08-27 |
> | Something1 | Something2 | Something3 | 2004-08-31 |
> | Something1 | Something2 | Something3 | 2004-09-11 |
> | Something1 | Something2 | Something3 | 2004-12-09 |
> | Something1 | Something2 | Something3 | 2004-04-29 |
> | Something1 | Something2 | Something3 | 2004-03-30 |
> +-------------+-------------+-------------+-------------+



Relevant Pages

  • Re: Generating an Index
    ... (remembering that in reality this Data column ... was a total number of 1's for each person and sort by that. ... I have seen some posts where people what to compare two strings to find ...
    (comp.databases.ms-access)
  • Re: Six years old
    ... no worries, in our time is good un isn't it. ... requires minimum effort on my part, and that doesn't sound like it to ... You add the data column, sort by date, and that is it, no ...
    (uk.comp.sys.mac)
  • Re: Generating an Index
    ... > what I have and what I am trying to achieve with this query. ... > The Data column is a text column, ... > the records are in order of "string distance" or similar. ... sort some values in the range 0 to 255, ...
    (comp.programming)
  • Re: How can I paste a column upside down?
    ... Sort the data column and the numbers column descending, ... Copy the data column and paste it. ... Sort the numbers column and the data column ascending. ... (Excel Add-ins / Excel Programming) ...
    (microsoft.public.excel.misc)