Forum Moderators: coopster

Message Too Old, No Replies

outputing values from mysql table

         

alenka99

2:24 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



I have problems with outputing values from a table in database

at below code i dont know how to output more then just one variable!
Please help
---------------

$result_array = array();
for ($count = 1; $row = mysql_fetch_row ($resultt); ++$count)
{
$result_array[$count] = addslashes($row[0]);
}
return $result_array;
}
-----------------------
function display_user_results

function display_user_results($result_array)
{
global $result_table;
$result_table = true;
?>
<br />
<form name=result_table action="delete_results.php" method=POST>
<table bgcolor=#bde1f0>
<?php
$color = "#3194ce";
if (is_array($result_array) && count($result_array)>0)
{
foreach ($result_array as $ex1, $ex2, $ex3, $ex4, $ex5, $ex6, $ex7, $ex8, $ex9, $ex10, $ex11, $ex12, $ex13, $ex14, $ex15, $ex16, $ex17, $ex18, $ex19, $ex20, $ex21, $ex22, $ex23, $ex24, $sum)
{

echo "<tr bgcolor=$color><td><a href=\"$ex1\">".htmlspecialchars($ex1)."</a></td>";
echo "</tr>";

<removed repetitive code>

echo "<tr bgcolor=$color><td><a href=\"$sum\">".htmlspecialchars($sum)."</a></td>";
echo "</tr>";
}
}
else
echo "<tr><td>Trenutno ni nobenega zapisa.</td></tr>";
?>
</table>
</form>
<?php
}
lp Alenkolina

[edited by: jatar_k at 5:24 pm (utc) on Jan. 19, 2004]
[edit reason] fixed sidescroll [/edit]

BitBanger

5:57 pm on Jan 20, 2004 (gmt 0)

10+ Year Member



Now i have found out-->the fields name shouldnt be just the number or what-->i realy did not know that!

But i still do not get it why did it work before?

Up till now you have not been referring to the fields by name, only by their position. This managed to avoid the naming restrictions.

alenka99

6:23 pm on Jan 20, 2004 (gmt 0)

10+ Year Member



Thanks, realy for all your help, my sistem is now nearly finished, so if any luck is with me, i wont bother you all anymore.

Realy thanks, Alenka

This 32 message thread spans 2 pages: 32