PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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?
// 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]";
$result = mysql_query("SELECT * FROM u_store WHERE uid = '$uid'") or die('Query failed. ' . mysql_error());
$array = mysql_fetch_assoc($result);
$array is an array of associative values for the result. To return the indexes uses mysql_fetch_row(). To return indexes and associative values use mysql_fetch_array().
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.