This script selects all the rows that i need but now how do i echo the fileds from each row that its found?
$connection = mysql_connect($host,$user,$password)
or die ("coudlnt connectto server.");
$db = mysql_select_db($database, $connection)
or die ("coulnt find database.");
$query = "SELECT * FROM CUSTO where PENDINGD=""";
$result = mysql_query($query)
or die ("yellow");
$num = mysql_num_rows($result);
$row = mysql_fetch_array($result);
extract($row);
Copyright © 2024 QUIZLS.COM - All rights reserved.
Answers & Comments
Verified answer
believes the mysql_fetch_array function will do it might have to do something like
while ($row = mysql_fetch_array($result)){
echo $row['field_name'] . "<br />";
}
* interesting line breaks wonders about <a href='googole.ca'>links</a>
You need to assign each row of data to a display string, this can be the whole string as a table :
$display_string ="<table><tr>
//add a heading row to the table
</tr>";
while($show_record = mysql_fetch_array($result)){
$display_string .="<tr>
<td>$show_record[field1]</td>
<td>$show_record[field2]</td>
//other fields
</tr>";
}
echo $display_string;
$diplay_string .="</table>";
The . before the = concatenates the current string to the original.