function problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

function problems

Post by Da_Elf »

having a problem with my function for some reason.
i get an error on line 9

Code: Select all

function skill_update($skill, $dbskill, $UIDs) {
$valuea = 1;
$valueb = 0;
if ($skill == 1){
$sqlCha1="Update skills SET $dbskill = ('$valuea') Where UserID= ('$UIDs')";
mysql_query($sqlCha1,$dbConn); 
}
else{
$sqlCha2="Update skills SET $dbskill = ('$valueb') Where UserID= ('$UIDs')";
mysql_query($sqlCha2,$dbConn); 
}
}
//variables
$dance=mysql_real_escape_string($_POST['Dancecheck']);
$poetry=mysql_real_escape_string($_POST['Poetrycheck']);
$film=mysql_real_escape_string($_POST['Filmcheck']);
$animation=mysql_real_escape_string($_POST['Animationcheck']);
$ID=mysql_real_escape_string($_POST['ID']);
 
//use
skill_update('$dance', 'dancer', '$ID');
skill_update('$poetry', 'peot', '$ID');
skill_update('$film', 'film', '$ID');
skill_update('$animation', 'anim', '$ID');
 
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: function problems

Post by AbraCadaver »

For starters, read: http://us3.php.net/manual/en/language.types.string.php

Code: Select all

skill_update($dance, 'dancer', $ID);
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

Re: function problems

Post by Da_Elf »

yeah. that was it. :( my bad
Post Reply