0 Members and 1 Guest are viewing this topic.
What did I do wrong? Tried installing ticket/support but when I click link in Admin I get : Warning: mysql_query() expects parameter 1 to be string, resource given in /home/angelvod/public_html/admin2/tickets.php on line 29
<?$includes[title]="View Ticket";function replace($txt) {$txt = str_replace(array("\r\n", "\n", "\r"), '<br>', $txt); return $txt;}if($_GET['id'] != "") $id=$_GET['id'];else if($_POST['id'] != "") $id=$_POST['id'];$viewid=$_GET['viewid'];$userinfo=$Db1->fetch_array($sql);$user=$userinfo;$id=$userinfo[userid];$fetch=mysql_fetch_object(mysql_query("SELECT * FROM helprc WHERE id='$viewid'"));if (!$fetch){echo "<B>Invalid Ticket ID</B>";exit();}$fetch2=mysql_fetch_object(mysql_query("SELECT * FROM helprcres WHERE id='$viewid'"));if(strip_tags($_POST['resp']) && strip_tags($_POST['respondtext'])){ $respondtext = strip_tags($_POST['respondtext']);$today = gmdate('Y-m-d h:i:s');mysql_query("UPDATE helprc SET status='On Hold', lastupdated='$today' WHERE id='$viewid'");mysql_query("INSERT INTO `helprcres` (`id`, `username`, `answer`) VALUES ('$viewid', '$username', '$respondtext');") or die (mysql_error());echo "You responded to your ticket!"; }$includes[content]="<a href=\"index.php?view=account&ac=helpreq&".$url_variables."\" class=\"acc2\">Back</a> <table width=\"90%\" class=\"tableData\"> <tr><th>Subject:</th></tr><tr><td>$fetch->subject</td></tr><tr><th>Question:</th></tr><tr><td>".replace($fetch->question)."</td></tr></table><table width=\"90%\" class=\"tableData\"> <tr><th>$fetch2->username ($fetch->lastupdated)</th></tr><tr><td>".replace($fetch2->answer)."</td></tr></table><br>".iif($permission==7,"<form id=\"form1\" method=\"post\" action=\"\"><table width=\"90%\" class=\"tableData\"><tr><th>Respond</th></tr><tr><td><textarea name=\"respondtext\" id=\"respondtext\" rows=\"6\" style=\"width:100%;\"></textarea> <p align=\"center\"><input type=\"submit\" name=\"resp\" id=\"resp\" value=\"Respond\" style=\"width:100%;\"/> </p></td></tr></table></form>")."";?>