Jump to content

FamousMortimer

New Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

FamousMortimer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, I have this code: if (mail($admin, $subject, $message, $header)) {               // Print a message.               echo '<h1 id="mainhead">Thank you!</h1>           <p>an official has been notified of your registration. </p><p><br /></p>';                       // Include the footer and the quit the script (to not show the form).               include ('./includes/footer.html');               exit();           } else { // If it did not run OK.               echo '<h1 id="mainhead">System Error</h1>               <p class="error">You could not be registered due to a system error.                 We apologize for any inconvenience.</p>'; // Public message.               echo 'fn=' . $fn . ' ln=' . $ln . ' e=' . $e;               include ('./includes/footer.html');               exit();           } the echo 'fn=' . $fn . ' ln=' . $ln . ' e=' . $e; returns correct values from the form, but I keep getting this error: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Apache2\htdocs\ripla\ripla_register.php on line 55 What should I do to fix (or reconfigure?) to get the email sent? Thanks...
  2. Hey thanks for the advice.  I put in the die() function and found out that the problem was in my query, a space in between a the mysql function and the parenthesis {i.e.: 'DATE_FORMAT^(' 'instead of DATE_FORMAT('} Also, I'm sorry for the "breaking the forum rule", thanks for informing me about the confusing practice, I had no idea it was that big of a deal.  I appologize. FM
  3. I am having a similar problem with a while loop.....I am trying to have a table where the rows alternate colors, so it becomes easier to read. here is my code: [code]   // Make the query.   $query = "SELECT last_name, first_name, DATE_FORMAT     (registration_date, '%M %d, %Y') AS dr, user_id FROM users     ORDER BY $order_by LIMIT $start, $display";   $result = mysql_query ($query); // Run the query. ...   // Fetch and print all the records.   $bg = '#eeeeee'; // Set the background color.   while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {       $bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee'); // Switch the background color.        echo '<tr bgcolor="' . $bg . '">         <td align="left"><a href="edit_user.php?id=' .           $row['user_id'] . '">Edit</a></td>         <td align="left"><a href="delete_user.php?id=' .           $row['user_id'] . '">Delete</a></td>         <td align="left">' . $row['last_name'] . '</td>         <td align="left">' . $row['first_name'] . '</td>         <td align="left">' . $row['dr'] . '</td>       </tr>       ';   }[/code] here is the error(warning) I keep getting: [code]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Apache2\htdocs\view_users.php on line 107[/code] Does anyone have any ideas as to why result becomes invalid?
  4. I am also having problems with PHP accessing MySQL. Currently I am trying to run a simple script just to test out the connection, but PHP will not execute anything.  Earlier I was getting the fatal error message saying the the mysql_connect() was an unidentified function(now I just get a blank browser screen).  I had (and still have) my php.ini file extension_dir="c:\php\ext" AND extension=php_mysql.dll (with no semicolon ';' in front). When I run my phpinfo() script, it says no information about mysql.  Also, when I take the semicolon away from other extensions, the phpinfo shows the requisite info for that extension.  WHAT IS GOING ON HERE!?!??! In my test script, I put echo statements before and after the mysql_connect() function and the browser doesn't show either of these echos. Can someone please give a little help..... P.S.  I am using apache and everything else that I do with PHP works fine, I don't know if that is relevant....
×
×
  • 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.