After this I call a function which needs this info, but when I echo this, it seems to have lost it’s value. I know SESSION is a superglobal so I don’t need to use global inside function on it. What could be the problem? The for loop is inside an if statement, and it seems to exist in there but inside the function it doesn’t.
I tried changing the order in which the function is declared to before and after, but nothing is happening.
I actually want the client_id, to insert it into an other table as foreign key.
I know I may get same names, I may add a email column to the table later.
What I mean is that I want:
$client_id = mysqli_query($dbc, $query2) or die('No data');