Suggest that you add the "or die" syntax to the other mysql queries.
 
olunkwaik <[EMAIL PROTECTED]> wrote:
  I removed the setcookie and ran the code and it shows this Warning.


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
result resource in /home/public_html/post1.php on line 77

This is the code again.
======================

<?php //connect to database
    include ("db_connect.php");
     $match = "SELECT id FROM registration WHERE username =
'".$_POST['username']."' AND password = '".$_POST['password']."';";
     $qry = mysql_query($match)
   or die ("could not match data because ".mysql_error());
     $num_rows = mysql_num_rows ($qry);
     if ($num_rows <= 0)
     {
    echo "Sorry,there is no Username $username with the specified
password.<br>";
      echo "<a href="" Again,</a>";
      exit;
     }else{
    // form and execute query statement
      $query = "SELECT email,first, family, FROM registration WHERE
username =
'$username'";
     $result = mysql_query($query);
      // matches found, format records
       list ($first, $family, $email) = mysql_fetch_row ($result);

     print "<h2>User Information:</h2>";
     print "<b>First:</b> $first <br>";
     print "<b>Family:</b> $family <br>";
     print "<b>Email:</b> $email <br>";
       print "<h2>Post Information:</h2>";
      // form n execute 'post' query

     $query = "SELECT username, post, date FROM post WHERE username
= '$username'
ORDER BY date DESC";
     $result = mysql_query ($query);

     print "<table border = 1>";
     print "<tr><th>Username</th><th>Post</th><th>Date</th></tr>";
      // format and display return rows

     while (list ($username, $post, $date) = mysql_fetch_row
($result)):
       print "<tr>";
     print "<td>$username</td><td>$post</td><td>$date</td>";
     print "</tr>";

     endwhile;
     print "</table>";
    echo "Click Here:<a href="" Out.</a>";
        }?>

======================







Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list



  SPONSORED LINKS
        Php mysql   Job postings
   
---------------------------------
  YAHOO! GROUPS LINKS

   
    Visit your group "php-list" on the web.
   
    To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
   
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

   
---------------------------------
 



           
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less.

[Non-text portions of this message have been removed]



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




SPONSORED LINKS
Php mysql Job postings


YAHOO! GROUPS LINKS




Reply via email to