Hi,
I have certain functions where I need to execute multiple SQL-queries right
after each other within a single function (INSERT, SELECT, UPDATE).
I'd like to hear the best coding practice in terms of variable names
for the queries. I want to avoid something like this:
Giving each variable inside the function a name like "$sqlInsertUser" and "$resultInsertUser" makes the code also not really readable...PHP Code:function doSomething() {
// insert query
$sql1 = "INSERT something";
$result1 = $db->query($sql1);
// select query
$sql2 = "SELECT something";
$result2 = $db->query($sql2);
// update query
$sql3 = "UPDATE something";
$result3 = $db->query($sql3)
}
![]()
someone who can give some input??






Bookmarks