Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\PHP5\www\registration-reports-result_testnet.php on line 137

code ?

Please post your code,We are not psychics here!hehe.

echo "query_join=".$query_join;

 $result_join=mysql_query($query_join,$link);// or die(mysql_error());

137 //while($row_join=mysql_fetch_array($result_join))
while($row_join=mysql_fetch_array($result_join))
{
    $name_n=$row_join['t1.personal_name'];
    echo "name from page=".$name_n;

Could you post your sql query please?I think that is where the error is coming...

$result_join is not a valid resource. Check $query_join by printing it out and executing it in phpmyadmin.

Ok Nav it is now working correctly....
But the echo statements after the query

while($row_join=mysql_fetch_array($result_join))
{
$name_n=$row_join;
echo "name from page=".$name_n;
is not working!!!!! There is no error messages displaying.. but there is nothing printing other than the query

Whats t1.personal_name ? Is t1 a table name ? If yes, then I would suggest you to use an alias for that column. For example,

$query="select t1.name as name, t2.dept_no as dept from emp t1, dept t2 where t1.dept_id=t2.dept_id";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
   $name=$row['name'];
   ...............
}

That ll solve your problem.

Cheers,
Naveen

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.