Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form results

Status
Not open for further replies.

apffal

Technical User
Joined
Apr 10, 2004
Messages
97
Location
PT
I would like to change the following code in order to get mysql search results on a form - not on a table - and also the numbers of records displayed.
How to do it ?
Thanks

That's my code

<html>
<head>
<title>Form</title>
</head>
<body>
<center>

<table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000">
<tr>
<td width="100"><b>Relator</b></td>
<td width="70"><b>Nºproc</b></td>
<td width="150"><b>Data</b></td>
<td width="200"><b>Descritor</b></td>
<td width="150"><b>Texto</b></td>
</tr>
<tr>
<td>

<?php
MYSQL_CONNECT("", "", "") OR DIE("DB connection unavailable");
@mysql_select_db( "") or die( "Unable to select database");
?>

<?php
//error message (not found message)begins
$XX = "No Record Found, to search again please close this window";
//query details table begins
$query = mysql_query("SELECT * FROM ac2000 WHERE $metode LIKE '%$search%' LIMIT 0, 50");

while ($row = @mysql_fetch_array($query))
{
$variable1=$row["RELATOR"];
$variable2=$row["N_PROC_"];
$variable3=$row["DATA_JULG_"];
$variable4=$row["DESCRITOR"];
$variable5=$row["TEXTO"];

//table layout for results

print ("<tr>");
print ("<td>$variable1</td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("<td>$variable5</td>");
print ("</tr>");

}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>
</table>
</center>

</body>
 
To change the number of records returned by the query, change the values of the LIMIT clause of your query. Information on this clause can be found in the MySQL online manual entry for SELECT queries.


The question about outputting the values in a form is too vague to be answered.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
My database includes a text field, whose records have usually 2000 or 3000 words - too much for display on a table.
So, I would like to get mysql search results and put them in a form with a dropdown list,with a large textarea.
Or - and that would be a better solution - put results on a grid and open the text field in a text file.
How to do it, if possible ?
 
I mean a dropdown list, like those in Microsoft FrontPage for storing database results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top