I am using mysql_fetch_assoc to retrieve and display an array; This is what I recieve upon loading the page:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource

I have researched it and do not understand it.

**Snippet*

while ($row = mysql_fetch_assoc('$result')) {
echo $row["emp_name"];
echo $row["emp address"];
}

Thank you,
Matthew

Recommended Answers

All 4 Replies

Wait. Doing something wrong in other areas of code I think. Will reply after making adjustments.

The error means your query has failed. Add error checking to that to find out more.

Member Avatar for iamthwee

Better to use mysqli as well and then prepare the statement.

<Closed>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.