Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 12th, 2002, 01:23 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Man My Brain Hurts

Can someone help me write code to enter my data into a webpage.
When i get my results from my php script, getting info from MYSQL it writes it so sloppy, Id like to put the info recieved in a nice HTML table. Any IDEAS? I have been trying for 3 dats now , and my brain is fried!
the page in question is
http://www.thevirtualpilotplanner.com/searchform1.php
the info in the middle is what id like to contain in an html table, or any table, with headers of
PilotID Departure Destination Route and Hours.
Please help!

Reply With Quote
  #2  
Old August 12th, 2002, 01:44 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Man My Brain Hurts

forgot to send my code, Told ya my brain isnt quite right now
<html>

<body>

<?php

mysql_connect (localhost, xxx, xxx);

mysql_select_db (xxx);
include("header.php");
if ($pilotid == "")
{$pilotid = '%';}

$result = mysql_query ("SELECT * FROM pirep
WHERE pilotid LIKE '$pilotid%'
");

if ($row = mysql_fetch_array($result)) {

do {

PRINT "<CENTER>";
PRINT "<BR>";
print $row["pilotid"];
print $row["departure"];
print $row["destination"];
print $row["route"];
print $row["hours"];
} while($row = mysql_fetch_array($result));

} else {print "Sorry, no records were found!";}
PRINT "<CENTER>";
PRINT "<BR>";
PRINT "<CENTER>";
include("footer2.php");
?>

</body>

</html>

Reply With Quote
  #3  
Old August 12th, 2002, 03:01 AM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Man My Brain Hurts

Here, give something like this a try:
php Code:
Original - php Code
  1. <html>
  2. <body>
  3. <?php
  4.  
  5. mysql_connect (localhost, xxx, xxx);
  6.  
  7. include("header.php");
  8. if ($pilotid == "")
  9.  {$pilotid = '%';}
  10.  
  11. $result = mysql_query ("SELECT * FROM pirep WHERE pilotid LIKE '$pilotid%'");
  12.  
  13. if ($row = mysql_fetch_array($result)) {
  14.  print "<CENTER>";
  15.  print "<TABLE BORDER="1">n";
  16.  print "<TR>n<TD><b>PilotID</b></TD>n";
  17.  print "<TD><b>Departure</b></TD>n";
  18.  print "<TD><b>Destination</b></TD>n";
  19.  print "<TD><b>Route</b></TD>n";
  20.  print "<TD><b>Hours</b></TD>n</TR>n";
  21.  do {
  22.   print "<TR>n";
  23.   print "<TD>{$row['pilotid']}</TD>n";
  24.   print "<TD>{$row['departure']}</TD>n";
  25.   print "<TD>{$row['destination']}</TD>n";
  26.   print "<TD>{$row['route']}</TD>n";
  27.   print "<TD>{$row['hours']}</TD>n";
  28.   print "</TR>n";
  29.  } while($row = mysql_fetch_array($result));
  30.  print "</TABLE>n</CENTERn";
  31. } else {print "Sorry, no records were found!";}
  32. print "<BR>n";
  33. include("footer2.php");
  34. ?>
  35. </body>
  36. </html>

Reply With Quote
  #4  
Old August 12th, 2002, 06:48 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Man My Brain Hurts

you rock!,
Thank you very Much!
Michael

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Man My Brain Hurts


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT