Hi,
Look at the code below first:
<?php
2
3 include "include_fns.php";
4 include "header_news.php";
5
6 $conn = db_connect();
7
8 $pages_sql = "select * from pages order by code";
9 $pages_result = mysql_query($pages_sql, $conn);
10
11 while ($pages = mysql_fetch_array($pages_result)) {
12
13 $story_sql = "select * from stories
14 where page = '$pages[code]'
15 and published is not null
16 order by published desc";
17 $story_result = mysql_query($story_sql, $conn);
18 if (mysql_num_rows($story_result)) {
19 $story = mysql_fetch_array($story_result);
20 print "<TABLE border=\"1\" width=685>";
21 print "<TR>";
22 print "<TD width=\"50%\">";
23 print "<H3>$pages[description]</H3>";
24 print $story[headline];
25 print "</TD>";
26 print "<TD ALIGN=RIGHT>";
27 print " ";
28 print "</TD>";
29 print "</TR>";
30 print "</TABLE>";
31 }
32 }
33
34 include "footer_news.php";
35 ?>
My problem is that I want to do the following:
==========================================
|
|
=========================================
|
| |
==========================================
|
| |
=========================================
So I thought a neat trick would be to before line 22 the following:
if ( $pages[code]="intro")
print "<TD >";
else
print "<TD width=\"50%\">";
The objective would be to have a whole row by like I describe above.
The thing is I don't want to write the same routine just for that
one row
and by that I mean put in another mysql call to the database.
Suggestion?
--
************************************************************
*** Phillip B. Bruce ***
*** http://pbbruce.home.mindspring.com ***
*** [EMAIL PROTECTED] ***
*** ***
*** "Have you ever noticed? Anybody going slower than ***
*** you is an idiot, and anyone going faster than you ***
*** is a maniac." - George Carlin ***
************************************************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]