Notice: Array to string conversion in Notice: Array to string conversion in arrays arrays

Notice: Array to string conversion in


The problem is that $money is an array and you are treating it like a string or a variable which can be easily converted to string. You should say something like:

 '.... Money:'.$money['money']


Even simpler:

$get = @mysql_query("SELECT money FROM players WHERE username = '" . $_SESSION['username'] . "'");

note the quotes around username in the $_SESSION reference.


One of reasons why you will get this Notice: Array to string conversion in… is that you are combining group of arrays. Example, sorting out several first and last names.

To echo elements of array properly, you can use the function, implode(separator, array)Example:

implode(' ', $var)

result:

first name[1], last name[1]first name[2], last name[2]

More examples from W3C.