Jump to content

andre88uk

Member
  • Posts

    5
  • Joined

  • Last visited

andre88uk's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok so from what i can understand fromt he brief reading it simply misses the name field off when yu put the heder code in but when u remove the header code it comes back yes ? if this is the cae i would be lead to think maybe a missing " or ' to close a echo/query/html output ie . would cuae all sorts of errors like that hth
  2. andre88uk

    php help

    The first $result = mysql_fetch_array($result); is for the thread name and stuff so doesnt affect that lower part... it seems its : $sql = "SELECT * FROM `forum_subscriptions` WHERE `tid` = '" . $tid . "' && `notified` = '0';"; echo $sql; $result = mysql_query($sql); echo " "; while ($row = mysql_fetch_array($result)) { That is the error but echo $sql returns: SELECT * FROM `forum_subscriptions` WHERE `tid` = '3980' && `notified` = '0'; Which is correct.. there are definitely two rows in the table
  3. Thats the way i do all my images on my social networking site with about 100k images. $sql = "INSERT INTO `images` (`imagename`,`user_id`)VALUES ('" . $_FILE['filename'] . "', '530');"; That inserts the filename and the user_id. And to retrieve simply do : $sql = "SELECT * from `images` WHERE `user_id` = '530'; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { echo "Image: "; } That simply pulls the image from the same directory as the script but u can just put relative dirs in fron to get from other locations echo "Image: ";
  4. andre88uk

    php help

    have the following code: function email_subscribers($tid,$post_id){ $sql = "SELECT thread_title FROM forum_threads WHERE thread_id = '" . $tid . "'"; $result = mysql_query($sql); $result = mysql_fetch_array($result); $thread_name = $result['thread_title'];//Get the title here $post_name = get_user_name_from_id($post_id); //Right we have the info shite $sql = "SELECT * FROM `forum_subscriptions` WHERE `tid` = '" . $tid . "' && `notified` = '0';"; echo $sql; $result = mysql_query($sql); echo " "; while ($row = mysql_fetch_array($result)) { print_r($row); $sql = "SELECT `user_name_unused`, `user_email` FROM date_profiles WHERE user_id = '" . $row['uid'] . "';"; $result = mysql_query($sql); $result = mysql_fetch_assoc($result); $Name = "Forum Subscriptions"; //senders name $email = "subscriptions@partipeeps.com"; //senders e-mail adress $recipient = $result['user_email']; //recipient $mail_body = "Hey " . $result['user_name_unused'] . ", \nThere has been a reply to a thread you are subscribed to entitled: \n" . $thread_name . " \nReponse posted by : " . $post_name . " \nYou will not recieve any more email notifications to this thread until you next log in"; //mail body $subject = "Subscription alert : " . $thread_name; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command /*$sql = "UPDATE forum_subscriptions SET `notified` = '1' WHERE `uid` = '" . $row['uid'] . "' && `tid` = '" . $tid . "';"; if(!mysql_query($sql)){ echo mysql_error(); }*/ } } when run it only gets the first line for the results and nothing more. also returns the error : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/partipee/public_html/forum/reply_do.php on line 126 Line 126 is while ($row = mysql_fetch_array($result)) { Muchio gracias in advance
×
×
  • Create New...