new to php - please help
Posted: Tue Mar 25, 2008 5:26 pm
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi - i am using flash with php and amfphp
here is an example of my code:
what i want to do is pass another variable to the function aswell as $live - so that the "FROM staff" can instead be told which table to select from i.e "FROM another_table", basically i want to pass to it the table to select from i.e "another_table" or "yet_another_table"
so in short instead of "staff" being hardcoded - i want to pass the table to select from
hope you can help
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi - i am using flash with php and amfphp
here is an example of my code:
what i want to do is pass another variable to the function aswell as $live - so that the "FROM staff" can instead be told which table to select from i.e "FROM another_table", basically i want to pass to it the table to select from i.e "another_table" or "yet_another_table"
so in short instead of "staff" being hardcoded - i want to pass the table to select from
hope you can help
Code: Select all
function getAllStaff ($live) {
// Create SQL statement
$sql = sprintf("SELECT * FROM staff WHERE live = '%s';",
$live);
// Trace the query in the NetConnection debugger
//NetDebug::trace($sql);
// Run query on database
$result = mysql_query($sql);
$return = Array();
while($row=mysql_fetch_object($result)) {
$row->last_updated = $this->datetime_mysql_to_mysoup($row->last_updated);
array_push($return, $row);
}
return $return;
}~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: