nomadcelt wrote:$query="SELECT * FROM pricing";
$result=mysql_query($query);
I had hoped that $result would be the text from the file BUT NO. It is 'Resource ID #3'.
SURELY there is an easier way to call text from a database field?
you're so close, heres how you do it.
youv created a database result set ($result), and you can use that to get the desired value from the 'FieldName'
do this.
$query="SELECT * FROM pricing";
$result = mysql_query($query);
$myvalue = mysql_result($result,0,"FieldName");
result sets start from row number zero, if you want to read additional rows from that result set, say, in a loop, you could do this.
$query="SELECT * FROM pricing";
$result = mysql_query($query);
for ($row = 0; $row < mysql_num_rows($result); $row++){
echo mysql_result($result,0,"FieldName")."<br>";
};
this second bit of code will output all the values for the chosen field, with a html line break after each value.
hth