Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AyKay47

  1. So you will want to ad the username onto the querystring if the page to be redirected to:

     

    header("location:home.html?username=" . $myusername);

     

    then in home.php you will grab the value using $_GET['username'];

  2. this is the line that we care about:

     

    $this->pmmodel->sendMessage($this->input->post('recipient[]'), $this->input->post('bcc[]'), $this->input->post('subject'), $this->input->post('message'), $this->input->post('sender'))) 

     

    you need to check the output of $this->input->post('recipient[]')

  3. basically these lines are screwing everything:

     

    foreach ($recipients as $recipient)
            {
                $recipientData = array(
                   'usersPersonalMessagesID' => $insertID,
                   'userID'    => $recipient
                );
            }

     

    1. $recipients needs to be an array, it's not.

    Do something like:

     

    if(!is_array($recipients))
    {
        echo "not an array";
        exit;
    }

     

    2. You will just be redefining $recipientData every loop, overwriting the previous values.

    Do something like:

     

    $recipientData = array();
    foreach ($recipients as $recipient)
            {
                $recipientData[$insertID][] = $recipient;
                );
            }

  4. then the SQL is simply not matching any results sets in the db table.

    Make sure the field types are correct and the values to be compared are correct etc..

  5. Something is not right here, if the select statement was printing out as it should, it would grab results data from the table, but it is not.

    Post the entire relevant code.

  6. alright, then try this:

     

    $sql = "SELECT * FROM project WHERE Module_Code = '$schemelevel' AND Available = 'Yes'";
    $result = mysql_query($sql) or die($sql .'<br />'. mysql_error());
    if(mysql_num_rows($result) == 0)
    {
        echo "no results <br/ >";
        echo $sql;
        exit;
    }
    while ($myrow = mysql_fetch_row($result))
    {
    //code
    }

  7. Is there any other code in the page?

    Try this debugging code and post the results:

     

    $sql = "SELECT * FROM project WHERE Module_Code = '$schemelevel' AND Available = 'Yes'";
    $result = mysql_query($sql) or die($sql .'<br />'. mysql_error());
    if(mysql_num_rows($result) == 0)
    {
        echo "no results";
        exit;
    }
    while ($myrow = mysql_fetch_row($result))
    {
    //code
    }

  8. mysql_query expects it's first argument to be a string containing valid SQL, which is what you have contained in $query.

    With $result, you are attempting to query a query resource, which is invalid, the code should read:

     

    $query = "SELECT * FROM project WHERE Module_Code = '$schemelevel' AND Available = 'Yes'";
    $result = mysql_query($query);
    while ($myrow = mysql_fetch_row($result))
    {
    //code
    }
    

  9. 1. Refer to thorpe's first reply for reference to the first error.

     

    2. The second error is caused by this line:

     

    $this->password = $this->md5(password);

     

    the function md5() is not derived from the Process class, but a PHP native function, so it should be just:

     

    $this->password = md5($password);

  10. Looks like you agree I need a "message" table?!  And I assume that I will need my existing "member" table??

     

    yes, the member table is needed to build relationships/references.

     

    But then again, do I need a table for the "Sender" and one for the "Recipient"?

     

    What are the relationships?

     

    no you do not need separate tables for just that data, the sender and recipient fields in the `message` table will relate to the member id field of the `member` table.

  11. In this statement...

     

    	$firstName = (isset($_SESSION['memberFirstName']) ? $_SESSION['memberFirstName'] : '');

     

     

    Can isset() be replaced with most other functions, e.g. empty(), is_numeric(), is_null(), etc??

     

    Thanks,

     

     

    Debbie

     

    the one thing I see wrong is you have the entire ternary wrapped in parenthesis, whereas you only want the condition wrapped.

    This could simply have been a typo, however wanted to point it out.

×
×
  • 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.