Customer reply email trouble

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
asilveri
Posts: 10
Joined: Mon Mar 09, 2009 5:58 pm

Customer reply email trouble

Post by asilveri »

Script URL:http://ruxchng.rutgers.edu/tickets/
Version of script:2.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

Hello, I have been trying to edit the new ticket reply feature to include the category name that the customer selected. I added a SELECT statement to get the category name given its id. It failed as it returns an unexpected value.

I added the following SELECT statement under the submit_ticket.php file:

$qry = "SELECT `name` FROM `".$hesk_settings['db_pfix']."categories` WHERE `id`='".$category."'";

$catname = hesk_dbQuery($qry);

$message=str_replace('%%CATEGORY%%',$catname,$message);

When the customer receives the email they get the following message:

Dear eeee,

Your Resource id #8 support ticket "Testing categories" has been submitted.
We try to reply to all tickets as soon as possible, usually within 24 hours.

Instead of saying "Resource id # 8" it should be saying the selected category name ("Dining Services Computer Support")

This is the contents of the mysql table:

mysql> SELECT * FROM hesk_categories;
+----+----------------------------------+-----------+
| id | name | cat_order |
+----+----------------------------------+-----------+
| 1 | Dining Services Computer Support | 10 |
| 10 | RU Express / Meal Plan | 20 |
| 6 | Other | 50 |
| 11 | Dining Services Facilities | 30 |
| 12 | Sanitarian | 40 |
+----+----------------------------------+-----------+

I also displayed the SELECT statement:

Your SELECT `name` FROM `hesk_categories` WHERE `id`='1' support ticket "Testing categories" has been submitted.

[/quote]
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

After the hesk_dbQuery you need to fetch results for example using hesk_dbFetchAssoc (or with original functions - after mysql_query() you need to use mysql_fetch_assoc() to get the result).

Change

Code: Select all

$catname = hesk_dbQuery($qry); 
to

Code: Select all

$myres = hesk_dbQuery($qry);
$mytmp = hesk_dbFetchAssoc($myres);
$catname = $mytmp['name'];
http://www.google.com/search?hl=en&q=php+mysql+tutorial
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
asilveri
Posts: 10
Joined: Mon Mar 09, 2009 5:58 pm

Thanks

Post by asilveri »

Thanks again Klemen for your prompt and effective response.

:D
Post Reply