Getting a variable to work in function params


Posted on 16th Feb 2014 07:03 pm by admin

I have this fuction which is inside a class:

Code: public static function generateEmbedCode($callId, $width="425", $height="320", $swfobjectPath="SDK/js/swfobject.js", $inviteButton="1", $guestList="1", $observerMode="0", $displayName="$nick") {
Blah Blah
}
What i need to do is grab some info and place it into a variable for $displayName="$nick" using:
Code: $memberid = (int)$_COOKIE['memberID'];
$sQuery = "SELECT * FROM `Profiles` WHERE `ID` = '$memberid'";
$result = db_res($sQuery);
while ( $p_arr = mysql_fetch_array( $result ) ) {
//get profile data
$nick = $p_arr['NickName'];
}
But I can't get it to work, my question is how can I get a variable to work inside the params of a function?? i hope this makes sense.

Thanks

No comments posted yet

Your Answer:

Login to answer
307 Like 8 Dislike
Previous forums Next forums
Other forums

SHOW TABLES Help
Hi all

I have the following

Code: [Select]<?php
$sql = "SHOW TABLES&quo

Web Application Recipe
Hi Guys!

I am working with the Web Application recipes. I am currently working on the sen

Record count of entire database
Does anyone know if there is a way to obtain the number of records in each table of the database usi

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

Accessing Infotype data in dialog program
Hi All
In Dialog programs attributes I didn't see any logical database field. How can I access

Most basic form question ever?
Hello,

I want to use this snippet to make sure the fields in a form are ok before processing

shift numbers with paging
Hi

How would i be able to display 10 numbers 1 2 3 4 5 6 7 8 9 10
and when I click next

Writing to the middle of a file
Hi I have a bit of a problem. Is there any way i can write some text to a middle of a text file. For

Login logout link help
Hi all,

Im new to php and Im having trouble creating a login/logout link for my page that dis

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash