- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm making a private messaging system.
But I got the error message just like this again an again.
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\post\includes\pm_send.php on line 12
pm_send.php code is here
<?php
session_start();
require_once "connect.php";
$sql = "SELECT id, email FROM users WHERE showing='1'";
$result = mysql_query($sql);
$options = "";
$email = $_SESSION['email'];
while ($row=mysql_fetch_array($result)){
$USERid = $row['id'];
$USERname = $row['email'];
$option.="<OPTION VALUE=\"$USERid\">".$USERname."</OPTION>";
}
?>
How to fix it?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue is not related to this forum....you may find a proper forum for MySQL or PHP to get the answer...
But the issue looks like to be related to the value of "$result" returned from "mysql_query", this function may return a bool value (FALSE) when the query failed (example: no permission), instead of a query data-set. You may refer to this link to get the answer:
Hope it helps.
Thanks,
Shenghong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello friend if you want to solve this problem then visit right now this post
How to fix Warning: mysql_fetch_array() expects parameter 1
i hope your problem is solved.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page