1: PDO use prepared statement which the meaning of prepared is something that we use it in many functions i think, and we prepared it for many functions.then i just want to know should i use diffrent sql query in all of my functions or should i define many query at first point in my init.php file(which include functions and connection to db)and then in each function pass them to the function to use these queries?just an example for what i described:
$query1 = "Insert into names(id,name) values (:id,:names)"
$query2 = "insert into games(id,name) values (:id,:names)"
and then for functions somtihing like this
function job($query){
//do the job
}
i ask this question because i read in some place i have to use this prepared statment in more than one place and if its true how should i use some unique query in a function?
2: can i use this :id :names in two prepared statement?or i have to set unique names?
$query1 = "Insert into names(id,name) values (:id,:names)"
$query2 = "insert into games(id,name) values (:id,:names)"
wont they conflict with each other?