sundog1 Posted November 26, 2011 Share Posted November 26, 2011 Hi Guys, I've come hear hoping someone will able to help me with a issue i'm having with PHP and MySQL. Basically, I've modified an installation of OS Ticket with help from the guys on the OS Ticket Forums (which are great by the way). The modification adds a Drop-down menu to the 'New Ticket' screen. The Drop-down menu is being populated by a Field called 'Catagory' within a MySQL table called 'Catagory' (I know, not the best thing to do, naming the table and field the same but i'm just testing at the moment ) I've managed to hack some script out of another modification so the drop-down menu works and the value selected is the written to another table which saves it as a 'Ticket'. Now the thing is, this coding is hacked and slashed to get it to work and to be honest I'm not really too sure on aspects of the code and how its doing what it's doing. I would love to know if there is a much simplier code to use to do the same thing? The code i'm using currently is below. </td> <th width="20%">Company:</th> <td width="20%"> <select name="CompanyName"> <option value="" selected>Select Company</option> <? $query ='SELECT * '. 'FROM category '. 'ORDER BY category ASC'; $services=db_query($query); while (list($projectId,$projectName) = db_fetch_row($services)) { $selected = ($info['project_id']==$projectId)?'selected':'';?> <option value="<?=$projectName?>"<?=$selected?>><?=$projectName?> </option> <? } ?> Many thanks for any adivce you guys out there can give me. Kind regards Mark. Quote Link to comment https://forums.phpfreaks.com/topic/251859-help-with-some-code-inside-os-ticket/ Share on other sites More sharing options...
sundog1 Posted November 28, 2011 Author Share Posted November 28, 2011 Anyone willing to help? Quote Link to comment https://forums.phpfreaks.com/topic/251859-help-with-some-code-inside-os-ticket/#findComment-1291760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.