Jump to content

kc9cdq

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kc9cdq's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks to everyone for looking, but I think I've figured out what I needed.... for now -Keith
  2. [!--quoteo(post=378771:date=May 31 2006, 01:13 PM:name=rathfon)--][div class=\'quotetop\']QUOTE(rathfon @ May 31 2006, 01:13 PM) [snapback]378771[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code]<?php require 'calinc.php'; $searchstr = $_POST['initials']; function displayadds($result) { print "<center><h1>Your Results</h1></center>"; print "\n<TABLE>\n<tr>\n" . "\n\t<th><b>School Name</b></th>" . "\n\t<th><b>Location</b></th>" . "\n\t<th><b>Date</b></th>" . "\n\t<th><b>Time</b></th>" . "\n\t<th><b>Number Working</b></th>" . "\n\t<th><b>Notes</b></th>" . "\n</tr>"; while ($row = @ mysql_fetch_row($result)) { print "\n<tr>"; foreach($row as $data) print "\n\t<td> {$data} </td>"; print "\n</tr>"; } print "\n</table>\n"; } $query = "SELECT SCHOOL, LOCATION, DATE, TIME, NOWORK, NOTES FROM calendar WHERE SB1 LIKE '%$searchstr%' or SB2 LIKE '%$searchstr%' or SB3 LIKE '%$searchstr%' or SB4 LIKE '%$searchstr%' or SB5 LIKE '%$searchstr%' or SB6 LIKE '%$searchstr%' or SB7 LIKE '%$searchstr%' or SB8 LIKE '%$searchstr%' or SB9 LIKE '%$searchstr%' or SB10 LIKE '%$searchstr%'"; if (!($connection = @ mysql_connect($hostname, $username, $password))) die("Unable to Connect"); if (!(mysql_select_db($databaseName, $connection))) showerror(); if (!($result = @ mysql_query ($query, $connection))) showerror(); displayadds($result); ?>[/code] First of all, you can use HTML in PHP files it is used the same way, so all those 'prints' are unnecessary. As far as I can tell, without running it, I see that you are slapping the results into a few tablerows. If you could take a picture of the results you get, and specify what you don't like about it, that'd be great and I could help you a lot easier if I knew what you wanted. If you don't have a host for files just upload here [a href=\"http://www.rathfun.com\" target=\"_blank\"]rathfun[/a]. [/quote] Thanks for the reply. I'm not sure how to attach a file here, but you can view the results here: [a href=\"http://www.grayteamers.com/results.php.htm\" target=\"_blank\"]http://www.grayteamers.com/results.php.htm[/a] I would like to have cell borders (essentially a grid around each cell) and add some cell padding. It doesn't have to be fancy, I just want it to be a little more readable than it is now. I would also love to see an example of the code without the print commands if that makes life easier. Thanks!!!
  3. Hi everyone: I'm just getting starting in PHP and MySQL and I'm stuck on something. I have a database search result page that is returning the proper results, but I'm having trouble figuring out how to format the results to make them more readable. Here's what I have so far: <?php require 'calinc.php'; $searchstr = $_POST['initials']; function displayadds($result) { print "<center><h1>Your Results</h1></center>"; print "\n<TABLE>\n<tr>\n" . "\n\t<th><b>School Name</b></th>" . "\n\t<th><b>Location</b></th>" . "\n\t<th><b>Date</b></th>" . "\n\t<th><b>Time</b></th>" . "\n\t<th><b>Number Working</b></th>" . "\n\t<th><b>Notes</b></th>" . "\n</tr>"; while ($row = @ mysql_fetch_row($result)) { print "\n<tr>"; foreach($row as $data) print "\n\t<td> {$data} </td>"; print "\n</tr>"; } print "\n</table>\n"; } $query = "SELECT SCHOOL, LOCATION, DATE, TIME, NOWORK, NOTES FROM calendar WHERE SB1 LIKE '%$searchstr%' or SB2 LIKE '%$searchstr%' or SB3 LIKE '%$searchstr%' or SB4 LIKE '%$searchstr%' or SB5 LIKE '%$searchstr%' or SB6 LIKE '%$searchstr%' or SB7 LIKE '%$searchstr%' or SB8 LIKE '%$searchstr%' or SB9 LIKE '%$searchstr%' or SB10 LIKE '%$searchstr%'"; if (!($connection = @ mysql_connect($hostname, $username, $password))) die("Unable to Connect"); if (!(mysql_select_db($databaseName, $connection))) showerror(); if (!($result = @ mysql_query ($query, $connection))) showerror(); displayadds($result); ?> Any input you have would be greatly appreciated. I'm looking to add table borders and increase the cell padding and spacing etc. Thanks!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.