Jump to content

[SOLVED] What do these errors mean?


monkeypaw201

Recommended Posts

I am getting these errors

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/human-resources/confirm.php on line 55

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/human-resources/confirm.php on line 58

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/human-resources/confirm.php on line 61

No recipient addresses found in header

 

when i run this code:

 

mysql_select_db("database", $connection);
$user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '" . $_POST['key'] . "' AND `email` = '" . $_POST['email'] . "'") or die(mysql_error());
$row_user = mysql_fetch_array($user);
$user_count = mysql_num_rows($user);

 

and im not sure what it means

Link to comment
Share on other sites

Ok, thanks, this is the code for the form ... i checked th variables.. but did i miss something?

 

<form name="form1" method="post" action="confirm.php">

  <table width="100%" border="0">

    <tr>

      <td>Activation Key:</td>

      <td><label>

        <input type="text" name="key" id="key" <?php if(isset($_GET['key'])){ echo "value=\"" . $_GET['key'] . "\" disabled"; } ?> />

      </label></td>

    </tr>

    <tr>

      <td>E-Mail Address:</td>

      <td><label>

        <input type="text" name="email" id="email" />

      </label></td>

    </tr>

    <tr>

      <td> </td>

      <td> </td>

    </tr>

    <tr>

      <td colspan="2"><label>

        <div align="center">

          <input type="submit" name="submit" id="button" value="Activate Account & Log-In">

          </div>

      </label></td>

    </tr>

  </table>

</form>

Link to comment
Share on other sites

1) always use mysql_escape_string to avoid mysql injection.

2) you have already used mysql_error(), so it should some error before these warnings if query is failing.

3) echo your query to check if key and email are passed properly.

4) Try to check if there are any records returned before fetching them

 

mysql_select_db("database", $con);
$user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '" . $_POST['key'] . "' AND `email` = '" . $_POST['email'] . "'") or die(mysql_error());
$user_count = mysql_num_rows($user);
if($user_count>0) {
$row_user = mysql_fetch_array($user);
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.