[CS-FSLUG] Looking for tips

K Montgomery keltik at albany.edu
Fri Jul 2 12:42:32 CDT 2004


David,

Deep breaths. :)

The following slightly modified code worked for me:

mysql_select_db('testing', $connect);
$myquery = "SELECT * FROM phpstore";
$result = mysql_query($myquery, $connect);
while ($row = mysql_fetch_row($result)) {
	echo $row[1];
}

(This returns the second field in each record.)
I tested this against a table with verified contents (i.e., not empty).

- Kathy

On Fri, 2004-07-02 at 12:43 -0400, David M. wrote:
> Thanks Steven, I'd appreciate it.
> 
> I was about to throw together a simple page to test my hand at this and I am 
> slightly stuck and highly mad at myself for not coding in the past few months 
> and now I have totally forgot how to use my sql statements.
> 
> I am very fusturated right now, cuz this once was a simple task, now turned 
> into almost a complete headache.
> 
> I am so mad at myself right now. I cannot figure why this code keeps 
> displaying "Resource Id #3" on the page instead of the contents of the field.
> 
> mysql_select_db('testing', $connect);
> $myquery = "SELECT * FROM phpstore";
> $result = mysql_query($myquery, $connect);
> while ($row = mysql_fetch_row($result));
> echo $result; 
> 
> I've even tried:
> echo $row[1];
> echo $row["1"];
> echo $row[0];
> 
> Still I either get the output "Resource Id #3" or nothing at all instead of 
> the desired contents of the "name" field.
> 
> I am very upset with this.





More information about the Christiansource mailing list