Re: [PHP-DB] formating problem

2002-02-21 Thread Andrés Felipe Hernández

jas,

Replace
 echo input type=\submit\ name=\delete\
 value=\delete\/form/table;
With:
 echo trtdinput type=\submit\ name=\delete\
 value=\delete\/td/tr/form/table;


- Original Message -
From: jas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 19, 2002 3:12 AM
Subject: [PHP-DB] formating problem


 I feel kinda dumb for posting this but here it is... I am trying to query
a
 table then format the results so it looks like the rest of the site and
the
 darn delete button to remove db entries keeps showing up at the top.  Here
 is the code... Thanks in advance.
 Jas
 ?php
 require '../scripts/db.php';
 $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
 execute query, please try again later);
 echo table border=\0\ class=\table-body\ width=\100%\form
 name=\rem_inv\ method=\post\ action=\done2.php3\
 trtd align=\center\ colspan=\2\font size=\4\BCurrent
 Inventory/B/fonthr color=\33\/td/tr;
 $count = -1;
 while ($myrow = mysql_fetch_row($result)) {
 $count ++;
 echo trtd width=\30%\BType Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_type));
 echo /tdtdinput type=\checkbox\ name=\car_type\
 value=\checkbox\remove/td
 /tr\n;
 echo trtd width=\30%\BModel Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_model));
 echo /td/tr\n;
 echo trtd width=\30%\BYear Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_year));
 echo /td/tr\n;
 echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
 printf(mysql_result($result,$count,car_price));
 echo /td/tr\n;
 echo trtd width=\30%\BVIN Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_vin));
 echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
 }
 echo input type=\submit\ name=\delete\
 value=\delete\/form/table;
 ?



 --
 PHP Database 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] formating problem

2002-02-19 Thread jas

I feel kinda dumb for posting this but here it is... I am trying to query a
table then format the results so it looks like the rest of the site and the
darn delete button to remove db entries keeps showing up at the top.  Here
is the code... Thanks in advance.
Jas
?php
require '../scripts/db.php';
$result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
execute query, please try again later);
echo table border=\0\ class=\table-body\ width=\100%\form
name=\rem_inv\ method=\post\ action=\done2.php3\
trtd align=\center\ colspan=\2\font size=\4\BCurrent
Inventory/B/fonthr color=\33\/td/tr;
$count = -1;
while ($myrow = mysql_fetch_row($result)) {
$count ++;
echo trtd width=\30%\BType Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_type));
echo /tdtdinput type=\checkbox\ name=\car_type\
value=\checkbox\remove/td
/tr\n;
echo trtd width=\30%\BModel Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_model));
echo /td/tr\n;
echo trtd width=\30%\BYear Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_year));
echo /td/tr\n;
echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
printf(mysql_result($result,$count,car_price));
echo /td/tr\n;
echo trtd width=\30%\BVIN Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_vin));
echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
}
echo input type=\submit\ name=\delete\
value=\delete\/form/table;
?



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




RE: [PHP-DB] formating problem

2002-02-19 Thread Beau Lebens

htat's because the delete button is in the wrong place in your code.

if you put an HTML element between the table and /table tags, but don't
enclose it in at least tr and td tags (pretty loose about closing them,
but of course you should always close your tags!) then the browser will
display that element above the table - since it doesn't really know where
you want it placed.

long story short, replace the last little section of your code with

echo tr\ntd colspan=\2\ align=\center\input type=\submit\
name=\delete\
value=\delete\/td\n/tr\n\n/form/table;
?

and PS. i don't know if you are doing it by mistake or intentionally, but
you may have noticed that form elements cause a certain amount of space to
be taken up because the browser decides to render them as a br or
something for some reason. if you put the form and /form elements
BETWEEN a tr and a td or a table and a tr or something (i.e. not
properly located in a td/td pair) then this formatting is not displayed
for some reason - go figure.

enjoy

beau


// -Original Message-
// From: jas [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 19 February 2002 7:13 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] formating problem
// 
// 
// I feel kinda dumb for posting this but here it is... I am 
// trying to query a
// table then format the results so it looks like the rest of 
// the site and the
// darn delete button to remove db entries keeps showing up at 
// the top.  Here
// is the code... Thanks in advance.
// Jas
// ?php
// require '../scripts/db.php';
// $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
// execute query, please try again later);
// echo table border=\0\ class=\table-body\ width=\100%\form
// name=\rem_inv\ method=\post\ action=\done2.php3\
// trtd align=\center\ colspan=\2\font size=\4\BCurrent
// Inventory/B/fonthr color=\33\/td/tr;
// $count = -1;
// while ($myrow = mysql_fetch_row($result)) {
// $count ++;
// echo trtd width=\30%\BType Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_type));
// echo /tdtdinput type=\checkbox\ name=\car_type\
// value=\checkbox\remove/td
// /tr\n;
// echo trtd width=\30%\BModel Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_model));
// echo /td/tr\n;
// echo trtd width=\30%\BYear Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_year));
// echo /td/tr\n;
// echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
// printf(mysql_result($result,$count,car_price));
// echo /td/tr\n;
// echo trtd width=\30%\BVIN Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_vin));
// echo /td/trtrtd colspan=\3\hr 
// color=\33\/td/tr\n;
// }
// echo input type=\submit\ name=\delete\
// value=\delete\/form/table;
// ?
// 
// 
// 
// -- 
// PHP Database 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