* Ultra Newbie Question Part 2 *
From: Julia Briggs (julia4_me_at_yahoo.com)
Date: 11/28/03
- Next message: DM: "Re: highlight new forum topics"
- Previous message: HamuNaptra: "Re: force download popup"
- Next in thread: DrTebi: "Re: * Ultra Newbie Question Part 2 *"
- Reply: DrTebi: "Re: * Ultra Newbie Question Part 2 *"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 |
> +-------------+-------------+-------------+-------------+
- Next message: DM: "Re: highlight new forum topics"
- Previous message: HamuNaptra: "Re: force download popup"
- Next in thread: DrTebi: "Re: * Ultra Newbie Question Part 2 *"
- Reply: DrTebi: "Re: * Ultra Newbie Question Part 2 *"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|