sc_lookup not returning any results?

I have a blank form that is called from a calling form passing [VolunteerID]. When I run the following code - nothing is returned in the sc_lookup macro. However, in the part below it, the [VolunteerID] is output correctly. Is there something wrong with my syntax?

PART 1----

$the_sql = “select badgeBarCode, lastName, firstName, volunteerGroup_volunteerGroupID from ticketpriority where volunteerID = '”.[VolunteerID]."’ ";
sc_lookup(my_info, $the_sql);

{badgeBarCode} = {my_info[0][0]};
{lastName} = {my_info[0][1]};
{firstName} = {my_info[0][2]};
{volunteerGroup_volunteerGroupID} = {my_info[0][3]};

PART 2 ---- The [VolunteerID] is working, but the {firstName} and {lastName} fields are not echoing correctly.

The variables do not echo correctly…this is what I am trying to resolve.

{
echo “Thank you “.”[VolunteerID]”.{firstName}." “.{lastName}.”, your volunteer request has been successfully received."."<br /><br />";

Hello,

You can activate debug mode (application --> settings) and see what SQL statement SC is generating on your sc_lookup.

regards,
Bernhard Bernsmann