RE: [PHP-DB] Re: [PHP] build menu with mysql data

2003-01-21 Thread Edward Peloke
Marc,

Here is the entire script...

It is doing a lot of things you don't need so you will have to sift through
it to see what you want.  If you have any questions, just ask.

Eddie


 


 
Depart
Location
# Pass
Return
Return
Location
Craft Preference
Lowest Bid
Add Bid






1){
# setup SQL statement
$SQL3 = "select min(amount), count(*) as count1 from bids where
clientreqid=".$myrow["id"]."";
#execute SQL statement
$result3= mysql_db_query($db,"$SQL3",$connection);
$myrow3=mysql_fetch_array($result3);
$count1=$myrow3["count1"];
print "";
if ($count1>0){
  print"";
  $minbid=$myrow3["min(amount)"];
}
if ($count1==0){
  print"";
  $minbid="No Bids";
   }
 print"".$myrow["departdate"]."";
print"".$myrow["departloc"]."";
print"".$myrow["numpass"]."";
print"$return";
print"".$myrow["returndate"]."";
print"";
print"".$myrow["craftpref"]."";
print"$minbid";
print "Add Bid";
   }

   if ($bidhist==1){
   # setup SQL statement
$SQL3 = "select min(amount), count(*) as count1 from bids where
clientreqid=".$myrow["id"]."";
#execute SQL statement
$result3= mysql_db_query($db,"$SQL3",$connection);
# setup SQL statement
$SQL4 = "select b.amount, DATE_FORMAT(b.timestamp, '%m/%d/%y')
as timestamp, o.corpname from bids b ,operators o where b.operatorid=o.id
and clientreqid='$clientreqid' order by b.amount,b.timestamp asc";
#execute SQL statement
$result4= mysql_db_query($db,"$SQL4",$connection);
$myrow3=mysql_fetch_array($result3);
$count1=$myrow3["count1"];


if($clientreqid==$myrow["id"]){
 print "";
if ($count1>0){
  print"";
 $minbid=$myrow3["min(amount)"];
}
if ($count1==0){
  print"";
  $minbid="No Bids";
   }
 print"".$myrow["departdate"]."";
print"".$myrow["departloc"]."";
print"".$myrow["numpass"]."";
print"$return";
print"".$myrow["returndate"]."";
print"";
print"".$myrow["craftpref"]."";
print"$minbid";
print "Add Bid";
  print" ";
  print"";
  print"";
  print"Bid
History";
  print" Operator";
  print" Bid";
  print" Bid
Date";
  print"";
  print"";
  print"";
  print "";
  while ($myrow4 = mysql_fetch_array($result4)){
   print "";
   print"";
   print"";
   print"";
   print"".$myrow4["corpname"]."";
   print"".$myrow4["amount"]."";
   print"".$myrow4["timestamp"]."";
   print"";
   print"";
   print"";

   print "";
 }
                        }

if($clientreqid<>$myrow["id"]){
   print "";
   if ($count1>0){
  print"";
  $minbid=$myrow3["min(amount)"];
}
if ($count1==0){
  print"";
  $minbid="No Bids";
   }
 print"".$myrow["departdate"]."";
print"".$myrow["departloc"]."";
print"".$myrow["numpass"]."";
print&quo

[PHP-DB] Re: [PHP] build menu with mysql data

2003-01-21 Thread Marc Bleuler
Hi Eddie,

This is exactly what I'm looking for. I don't have some code today that's
why I'm posting to the newsgroup. The only working thing I have today is the
listing of the "main db"
It looks a bit whired since I copy past it from the file.
Could you post some of your code?


-
print "$html_body_in";
   print "Systems";
   print "";
  print "";
 print "";
print "Name";
print "Vendor";
   print "Description";
 print "\t\n";
   print "\n";

   $query="SELECT system.*, vendor.* FROM system, vendor where system.VENDOR
= vendor.ID order by system.NAME ASC";
   $result=mysql_query($query);
   $num=mysql_numrows($result);

   $i=0;

   while ($i < $num) {
   $system_id=mysql_result($result,$i,"system.ID");
   $system_name=mysql_result($result,$i,"system.NAME");
   $vendor_name=mysql_result($result,$i,"vendor.NAME");
   $vendor_id=mysql_result($result,$i,"vendor.ID");
   $system_description=mysql_result($result,$i,"system.DESCRIPTION");


   print "";
print "";
  print "";
   print "$sy
stem_name";
print "
$vendor_name";
   print "$system_description";
print "";
   print "";
print "";

   print "";
  print "";

   ++$i;
   }


-

br Marc


   print "$html_body_out";
"Edward Peloke" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Marc,
>
> I did something sort of along these lines with an 'auction' site I worked
> on.  I displayed rows from a db.  If the row had bid information in the db
> (or your case submenu info) then a + sign icon was displayed next to it.
IF
> the plus sign was clicked, the page would reload and the bid or submenu
info
> would be displayed and the + sign would change to a - sign to give the
> appearence of a tree menu.   Can you post some of your code?
>
> Eddie
>
> -Original Message-
> From: Marc Bleuler [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 21, 2003 12:31 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] build menu with mysql data
>
>
> Hi,
>
> I would like to bild a tree menu with mySQL data. where I have the
collapsed
> main menue and when I click the link the specific submenue expands (as
> follow).
>
> (collapsed Main Menu)
> + Home
> + Downloads
> + About me
> + Search
>
> and for example if I click the "Download" section it will look as
> follow
>
> (expanded Main-Sub Menu)
> + Home
> + Downloads
> - Music
> - Programm
> + About me
> + Search
>
> and the SQL Tables...
>
> MAINMENUE_TABLE
> IDNAME
> -
> |1|Home|
> |2|Downloads|
> |3|About me  |
> |4|Search   |
>
> and
>
> SUBMENUE_TABLE
> IDMAIN_ID  NAMEURL
> ---
> |1|2|Music|
> ./somefile.php?action=music
> |2|2|Programm |
> ./somefile.php?action=programm
> |3|3|Pictures |
> ./somefile.php?action=pictures
> |4|3|Address|
> ./somefile.php?action=address
> |5|4|My Page   |
> ./somefile.php?action=mypage
> |6|4|The Web   |
> ./somefile.php?action=theweb
> |7|4|Google  |
> ./somefile.php?action=google
>
>
> If I'm using a while loop it won't work, so I realy don't have and more
> ideas...
> Please consider in your explanations I'm a PHP beginner... :-)
>
> thanks
> Marc
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] RE: [PHP] build menu with mysql data

2003-01-21 Thread Edward Peloke
Marc,

I did something sort of along these lines with an 'auction' site I worked
on.  I displayed rows from a db.  If the row had bid information in the db
(or your case submenu info) then a + sign icon was displayed next to it.  IF
the plus sign was clicked, the page would reload and the bid or submenu info
would be displayed and the + sign would change to a - sign to give the
appearence of a tree menu.   Can you post some of your code?

Eddie

-Original Message-
From: Marc Bleuler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 12:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] build menu with mysql data


Hi,

I would like to bild a tree menu with mySQL data. where I have the collapsed
main menue and when I click the link the specific submenue expands (as
follow).

(collapsed Main Menu)
+ Home
+ Downloads
+ About me
+ Search

and for example if I click the "Download" section it will look as
follow

(expanded Main-Sub Menu)
+ Home
+ Downloads
- Music
- Programm
+ About me
+ Search

and the SQL Tables...

MAINMENUE_TABLE
IDNAME
-
|1|Home|
|2|Downloads|
|3|About me  |
|4|Search   |

and

SUBMENUE_TABLE
IDMAIN_ID  NAMEURL
---
|1|2|Music|
./somefile.php?action=music
|2|2|Programm |
./somefile.php?action=programm
|3|3|Pictures |
./somefile.php?action=pictures
|4|3|Address|
./somefile.php?action=address
|5|4|My Page   |
./somefile.php?action=mypage
|6|4|The Web   |
./somefile.php?action=theweb
|7|4|Google  |
./somefile.php?action=google


If I'm using a while loop it won't work, so I realy don't have and more
ideas...
Please consider in your explanations I'm a PHP beginner... :-)

thanks
Marc



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php