MYSQL Fields with brackets in them?
Posted: Thu Aug 11, 2005 9:25 pm
Hey I was working on a PHP script and I wanted to have some of my mysql fields names be in the form of an array but it won't work with mysql_fetch_object is there a way to do this? Or is there a better way of doing what I am trying to do?
I don't get anything as output.
Code: Select all
// the name of my field is "buyamount[0]"
$result = mysql_query("SELECT * FROM u_store WHERE uid = '$uid'") or die('Query failed. ' . mysql_error());
$store = mysql_fetch_object( $result );
echo "$store->buyamount[0]";