Page 1 of 1

displaying result in html!

Posted: Wed Dec 18, 2002 3:23 am
by sirTemplar
hello! i need help anyone!

the php code is this:
if ($CNOMEN == "")
{$CNOMEN = '%';}

if ($NOMRL == "")
{$NOMRL = '%';}
// $some_data_1 and $some_data_2 are the two column names I used. Change this to fit your database
$result = mysql_query ("SELECT * FROM friarsofmconv
WHERE CNOMEN LIKE '%$CNOMEN%'
AND NOMRL LIKE '%$NOMRL%'
",$conn);

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

do {
PRINT "<b>Surname:</b> ";
print $row["CNOMEN"];
print ("<br>");
PRINT "<b>Name:</b> ";
print $row["NOMRL"];
print ("<br>");
PRINT "<b>Province/Custody:</b>";
print $row["PROVEN"];
print ("<br>");
PRINT "<b>Ordination:</b>";
print $row["SACDAT1"];
print ("<p>");
print ("<p>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";}

?>
the result is this:
Surname: Garavito Pérez
Name: Rafael José
Province/Custody:Columbia - Provincial Custody (Spain)
Ordination:27/01/19
how do i put the results in a table and able to change the fonts and colors of the result? thanks

:(

Posted: Wed Dec 18, 2002 5:58 am
by SublicK
You would just have to print out the html with the results.

something like

Code: Select all

do &#123; 

echo "<table><tr><td>Surname:</td><td>&#123;$row&#1111;'CNOMEN']&#125;</td></tr>";
echo "<tr><td>Name:</td><td>&#123;$row&#1111;'NOMRL']&#125;</td></tr></table>";

... etc ...

&#125; while($row = mysql_fetch_array($result));

Posted: Wed Dec 18, 2002 9:14 am
by sirTemplar
thanks! :D