How to store arrays in MySQL?

The proper way to do this is to use multiple tables and JOIN them in your queries. For example: The person_fruit table contains one row for each fruit a person is associated with and effectively links the person and fruits tables together, I.E. When you want to retrieve a person and all of their fruit … Read more

Trying to get property of non-object in

Check the manual for mysql_fetch_object(). It returns an object, not an array of objects. I’m guessing you want something like this Might I suggest you have a look at PDO. PDOStatement::fetchAll(PDO::FETCH_OBJ) does what you assumed mysql_fetch_object() to do

how to overcome ERROR 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (using password: NO) permanently

for some reason, the ODBC user is the default username under windows even if you didn’t create that user at setup time. simply typing without specifying a username will attempt to connect with the non-existent ODBC username, and give: Error 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (using password: NO) Instead, try specifying a username … Read more

MySQL Error 1264: out of range value for column

The value 3172978990 is greater than 2147483647 – the maximum value for INT – hence the error. MySQL integer types and their ranges are listed here. Also note that the (10) in INT(10) does not define the “size” of an integer. It specifies the display width of the column. This information is advisory only. To fix the error, change your datatype to VARCHAR. Phone and … Read more