PHP Question
#1

In my column "Jobs" there is ID's but i want to change ID's to characters to show in signature. I mean, i am using Signature Player Stats.
Reply
#2

Make a function that matches the job id with the name of the job. Example: if($jobid == 1) echo "mechanic";
Reply
#3

PHP код:
<?php
    
function get_job_Name($id)    {
        switch(
$id) {
            case 
'1':    // Id of job
                
echo('Job Name of id 1');
                break;
                
            case 
'2':    // Id of job
                
echo('Job Name of id 2');
                break;
        
            
// ...
            
            
default:
                echo(
'Unknow job name.');
                break;
            
        }
    }
    
    
get_job_Name('1');   // For example i would show the name of job id 1 ..
    
?>
Reply
#4

Just giving out codes will never make him learn.
Reply
#5

Yea and i want to show in signature, I am using imagettftext


PHP код:
$Job=mysql_result($result,0,"job"); 
[php]
PHP код:
$text_job "$Job"
PHP код:
    if($Job == 1)
    {
    
imagettftext($im80274610xFFFFFF$font'Mechanic'); 
    } 
I did it ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)