Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-15-2010, 08:30 AM   #1 (permalink)
Junior Member
 
Join Date: Jul 2010
Posts: 7
Exclamation Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Volumes/MACSERVER/MAMPM/DATA/search.php on line 11

can you help me?

the line is


while ($row = mysql_fetch_array($result)) {

thanks if you want more info then ask
yaxar is offline   Reply With Quote
Sponsored Links
Old 07-18-2010, 02:38 PM   #2 (permalink)
swg
Junior Member
 
Join Date: Feb 2010
Posts: 23
Default Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resou

the $result is now a MySQL result, i.e. there is an error in your mysql_query()
swg is offline   Reply With Quote
Old 07-20-2010, 12:09 PM   #3 (permalink)
Junior Member
 
Join Date: Jul 2010
Posts: 73
Default Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resou

as swg said is an mysql error. You could use a php line like:
$query = mysql_query("query string") or die(mysql_query());
to identify the problem.
johnny.dacu is offline   Reply With Quote
Old 07-21-2010, 03:04 AM   #4 (permalink)
Junior Member
 
Join Date: Jul 2010
Posts: 7
Thumbs up Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resou

Thanks

fixxed
yaxar is offline   Reply With Quote
Old 08-03-2010, 02:36 AM   #5 (permalink)
Junior Member
 
manzar's Avatar
 
Join Date: Jul 2010
Posts: 53
Default Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resou

see this example
<?php

$query = 'select * from table_name';
$result = mysql_query($query);
$no = mysql_num_rows($result);


if($no ==0)
echo "Table is empty</td></tr>";

while($row=mysql_fetch_object($result)){

echo "$row->username</td>

?>
manzar is offline   Reply With Quote
Old 08-19-2010, 12:49 AM   #6 (permalink)
Junior Member
 
Join Date: Aug 2010
Posts: 23
Default Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resou

Hi, here we mention the code that completely match your prob, just see them

<?php
if(isset($_POST['posted']))
{
$name=$_POST['dir_username'];
$pass=$_POST['dir_password'];
$connect=mysql_connect('localhost','root','');
$db=mysql_select_db('dir_db',$connect);
$query=mysql_query('SELECT * FROM dir_login',$connect);
while($row=mysql_fetch_array($query))

{
$column1=$row['username'];
$column2=$row['password'];
if($column1 == $name && $column2 == $pass)
{
header('location:registration_dir.php');
}
else
{
echo('Sorry Username and password is mismatch');
exit();
}
}
}

?>

<form name="index_dir" method="post" action="index_dir.php">
<table align="center" border="">
<tr>
<td>
<b style="background-color:#063">USERNAME</b>
<input type="text" name="dir_username" value="USERNAME" style="background-color:#966">
</td>
</tr>
<tr>
<td><b style="background-color:#063">PASSWORD</b>
<input type="password" name="dir_password" value="*****" style="background-color:#966">
</td>
</tr>
<tr>
<td><input type="hidden" name="posted" value="true>"></td>
<td>
<input type="submit" name="dir_submir" value="GO" style="background-color:#063">
</td>
</tr>
</table>
</form>

here we give an login script, where we used the proper meaning of you prob, see carefully.
sandy_j_sam is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:55 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting