This topic is locked

DBLOOKUP PROBLEM

7/22/2019 3:05:32 PM
PHPRunner General questions
H
harveyspecter author
$_SESSION['SORUMLU_ID'] = $data["sorumlu_id"];
$SORUMLU_ID = $_SESSION['SORUMLU_ID']
$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '$SORUMLU_ID'";
$email=$emailadresi;

$from="blabla@gmail.com";

$msg="Hello there\nBest regards";

$subject="Sample Mail";

$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];


I got this for to mail user who is responsible of the record. I got syntax error on:

$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '$SORUMLU_ID'";


I put it on Edit Page - After Record Update.
Can you help.
Thanks alot.

J
John 7/22/2019

Syntax error:$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '$SORUMLU_ID'";
should be
$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '".$SORUMLU_ID."'";
John

admin 7/22/2019

You are missing the closing parenthesis:

$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '$SORUMLU_ID'");
H
harveyspecter author 7/23/2019



You are missing the closing parenthesis:

$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '$SORUMLU_ID'");



I copied it but still i got a syntax error :/

H
harveyspecter author 7/23/2019



Syntax error:$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '$SORUMLU_ID'";
should be
$emailadresi = DBLookup("SELECT email FROM stratosfer_v3_users where ID = '".$SORUMLU_ID."'";
John



Its not working too <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=88287&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

admin 7/23/2019

A first troubleshooting step - print your SQL query on the page instead of executing it. Make sure it looks good, test it manually against your database.
Also, take your time to explain what exactly you did and what are the exact results you get. Saying "Its not working" and expecting other people to do your work for you won't cut.