$mysqli = new mysqli(\'localhost\', \'my_user\', \'my_password\', \'world\');
/* check connection */
if (mysqli_connect_errno()) {
printf(\"Connect failed: %s\\n\",
bind_param
accepts references, if your unsure what references exactly are then click here for the extract named as "references explained"
This does mean, it is valid to set your variables after the bind_param
but then again, it's down to preference how you wish to do it. I for one, prefer declaring the variables prior to the bind
Little observation
The variables are declared prior to the execute, and as PHP works from top to bottom processing. When the variables are actully needed (on the execution) they would have already been set, if you declare your variables after the execute()
you will be prompted with SQL Failures and other unwanted php errors