Zaloguj | Zarejestruj | FAQ
Anonymous

Please, I need an Urgent help.

+ Odpowiedz

Posty: 8 Strona 1 z 1


Please, I need an Urgent help.

przez ebynasco » Pn kwi 14, 2014 1:08 pm

I wrote a program with php, with intention of achieving log in and log out page. After i must have achieved that. Then i tried logging in with a username and password, then i saw 'Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C: \wamp\www\login.php on line 177' what should I do?
Avatar użytkownika

ebynasco

  • Posty: 8
  • Dołączył(a): Cz mar 06, 2014 7:01 am

Re: Please, I need an Urgent help.

przez XainPro » Pn kwi 14, 2014 3:28 pm

mysql_fetch_assoc() expects parameter 1 to be resource, boolean given
means your query got no result or your query is not correct there is nothing in your result to fetch
show us your complete code to help you.
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Please, I need an Urgent help.

przez ebynasco » Wt kwi 15, 2014 7:30 am

This is part of it sir.

173 $sql = "SELECT * FROM members WHERE confirmation = '1' AND type != 'uploads/propic.jpg' ORDER BY RAND() LIMIT 9";
174 $result = mysql_query($sql);
175 if($result > 0){
176 echo '<div align = "center" style = "margin-left: 35px; background: #111; color: #fff; width: 250px;"friends</div>';}
177 while($row = mysql_fetch_assoc($result))
178 {$first = $row['image'];
at line 177 i do have problem.
Avatar użytkownika

ebynasco

  • Posty: 8
  • Dołączył(a): Cz mar 06, 2014 7:01 am

Re: Please, I need an Urgent help.

przez XainPro » Wt kwi 15, 2014 7:48 am

make correction to you line no 175

if(mysql_num_rows($result) > 0)
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Please, I need an Urgent help.

przez ebynasco » Wt kwi 15, 2014 10:40 pm

Sir, I did the correction. But, no difference. Instead, I saw the same error that appeared previously, both on line 177 and 175. I don't know what to do.
Avatar użytkownika

ebynasco

  • Posty: 8
  • Dołączył(a): Cz mar 06, 2014 7:01 am

Re: Please, I need an Urgent help.

przez XainPro » Śr kwi 16, 2014 10:32 pm

then there should be some kind of error in your query add following code between line no 174 and 175

echo mysql_error($result) . "\n";

and check and tell me the output
it will show you what is the error in your query
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Please, I need an Urgent help.

przez ebynasco » Cz kwi 17, 2014 8:16 am

The same error do show on line 175. I'm just totally confused on what should be the problem. Because all the programs i wrote are in order.
Avatar użytkownika

ebynasco

  • Posty: 8
  • Dołączył(a): Cz mar 06, 2014 7:01 am

Re: Please, I need an Urgent help.

przez XainPro » Cz kwi 17, 2014 9:10 am

i am saying you to do this and tell me this output

173 $sql = "SELECT * FROM members WHERE confirmation = '1' AND type != 'uploads/propic.jpg' ORDER BY RAND() LIMIT 9";
174 $result = mysql_query($sql);
175 echo mysql_error($result);
176 die();
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm


+ Odpowiedz

Strona 1 z 1