Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   why it is not working (http://www.go4expert.com/forums/why-it-is-not-working-t19566/)

anchitjindal07 27Sep2009 01:15

why it is not working
 
$selct="SELECT * FROM stu_info";

$result=mysql_query($selct,$status);
while($row = mysql_fetch_array('$result',MYSQL_BOTH))
{
echo $row['Name'],$row['Father s Name'],$row['Address'],$row['Date of birth'],$row['Course'],$row['Branch'],$row['Batch'],$row['Roll No.'],$row['Univ. Reg. No.'],$row['Gender'];
echo "<br />";
}

Above code is giving following Warning:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\EasyPHP 3.0\www\process.php on line 44

Plz help

nimesh 27Sep2009 21:45

Re: why it is not working
 
I think here's the mistake:
$result will go without quotes in mysql_fetch_array()

while($row = mysql_fetch_array($result,MYSQL_BOTH))

http://in2.php.net/manual/en/functio...etch-array.php

anchitjindal07 27Sep2009 22:18

Re: why it is not working
 
But the same warning is still there

nimesh 28Sep2009 20:17

Re: why it is not working
 
Sorry, I don't know php, so can't help much

Maybe some expert would be able to help you.

Shabbir: Can you check this one?

shabbir 29Sep2009 11:36

Re: why it is not working
 
$result is a variable which is passed in quotes for the function. Try removing the single quotes and see what happens.


All times are GMT +5.5. The time now is 18:35.