Jump to content

Help with some Code inside OS Ticket


sundog1

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.