Ok so I know you can run queries in a function, I'm working on making my own message board system in PHP/MySQL and it's nearly in usable form, but I want to clean up my code and figured functions would work great.
For example this is what I'm trying right now and it's giving me an error:
Warning: Missing argument 1 for simple() in
function simple($table) {
$sql = “SELECT * FROM “.$table;
$result = mysql_query($sql);
return $result;
}
What am I doing wrong? table i'm trying to pull information from is users and I want to pull the Username filed.
For example this is what I'm trying right now and it's giving me an error:
Warning: Missing argument 1 for simple() in
function simple($table) {
$sql = “SELECT * FROM “.$table;
$result = mysql_query($sql);
return $result;
}
What am I doing wrong? table i'm trying to pull information from is users and I want to pull the Username filed.
Last edited: