what is mysql_fetch_array() expects parameter 1 to be resour

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: what is mysql_fetch_array() expects parameter 1 to be re

Post by johnj » Thu Apr 11, 2013 12:13 am

Check if your table has enough records and it is able to pull them. Looks like the query is returning boolean false.

User avatar
sandeep605085
New php-forum User
New php-forum User
Posts: 44
Joined: Tue Feb 26, 2013 6:00 am
Location: Mindfire Solutions
Contact:

Re: what is mysql_fetch_array() expects parameter 1 to be re

Post by sandeep605085 » Thu Apr 11, 2013 4:57 am

I guess
the problem is in line number 17 that is id is not defined.
may be id is not posted to this page correctly that why the below query is not working which give again the error at line 21.

$strSQL = "SELECT * FROM login WHERE id=" . $_GET["id"];

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: what is mysql_fetch_array() expects parameter 1 to be re

Post by johnj » Thu Apr 11, 2013 8:41 pm

If you id=1 and if it is working that means what ever you have in $_GET["id"] is not present in your database. Please print the SQL query to see why this is going wrong.

User avatar
sandeep605085
New php-forum User
New php-forum User
Posts: 44
Joined: Tue Feb 26, 2013 6:00 am
Location: Mindfire Solutions
Contact:

Re: what is mysql_fetch_array() expects parameter 1 to be re

Post by sandeep605085 » Thu Apr 11, 2013 10:21 pm

you must be posting some data to this page. so the posted data is not including any 'id' parameter that is why the value of $_get['id'] is blank. so please check your posted parameters.
OR
if you can post the code here then i can help you for sure to fix the issue by looking at the code(the current page code that is person.php and the page which is calling person.php)

Nicknnick
New php-forum User
New php-forum User
Posts: 8
Joined: Tue Apr 30, 2013 3:31 pm

Re: what is mysql_fetch_array() expects parameter 1 to be re

Post by Nicknnick » Tue Apr 30, 2013 5:03 pm

may be you need to define your id primary key in your database, i am not sure but you can try it..!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest