Re: MySQL/PHP Error! Programming Web Development by n21115 ….php.net/manual/en/function.mysql-fetch-array.php) or [mysql_fetch_assoc](http://php.net/manual/en/function.mysql-fetch-assoc.php), and, go through a… Re: Return Car Make from MySQL database & have the make hyperlinked. Programming Web Development by vidaj …. Then you get your result back, and you can fetch the values. [code=php] // Connect to the database… associative array // http://no2.php.net/manual/en/function.mysql-fetch-assoc.php while ($row = mysql_fetch_assoc($result)) { // Now …See [url]http://no2.php.net/manual/en/ref.mysql.php[/url] for more information about the different mysql_… Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL Programming Web Development by broj1 [mysql_fetch_array](http://php.net/manual/en/function.mysql-fetch-array.php) function returns result in both associative and numeric arrays while [mysql_fetch_assoc](http://php.net/manual/en/function.mysql-fetch-assoc.php) function returns result only in an associative array. It is the matter of what you want when choosing among them. Re: Help me to write mysql query in PHP Programming Web Development by pritaeas Read in this order: http://php.net/manual/en/function.mysql-connect.php http://php.net/manual/en/function.mysql-select-db.php http://php.net/manual/en/function.mysql-query.php http://php.net/manual/en/function.mysql-fetch-assoc.php Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL Programming Web Development by bradly.spicer just a headsup, they are removing this function http://php.net/manual/en/function.mysql-fetch-assoc.php Re: Mysqli fetch row not display Programming Web Development by cereal Try with `$row[0]` and `$row[1]`, the fetch row method returns a numeric array, use `fetch_assoc()` if you want to use the column names: * http://www.php.net/manual/en/mysqli-result.fetch-assoc.php Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL Programming Web Development by broj1 … I am not sure whether `&&` is valid in mysql. Also a backtick was missing after the `Category`. $query=mysql_query… to newer [mysqli](http://php.net/manual/en/mysqli-result.fetch-assoc.php) instead of older mysql, when possible. Re: Supplied argument is not a valid MySQL result Programming Web Development by monica singh Hi Dear, Try to use[B] mysql_fetch_array() with MYSQL_NUM[/B] or [B]mysql_fetch_array() with MYSQL_ASSOC[/B] or [B]mysql_fetch_array() with MYSQL_BOTH[/B] As in ur code ur r fetching the records by the field name so use MYSQL_ ASSOC(). For Example you can check this link [url]http://php.net/manual/en/function.mysql-fetch-array.php[/url] Re: Issue with fetch row Programming Web Development by as.bhanuprakash … through the following [url]http://php.net/manual/en/function.mysql-fetch-assoc.php[/url] Re: Help on PHP Fetch from database!!! Programming Web Development by Biiim [QUOTE=saybabs;1704878]so do you advice me to use assoc instead of array?[/QUOTE] Nah it will make no difference,…www.php.net/manual/en/function.mysql-fetch-array.php[/url] it should save processing time using assoc though Using the session to… will be accessed via $_POST['compcode']; and do the mysql query on that page to get the data Re: Trying to fetch associative array with prepared statements Programming Web Development by LastMitch …weird you have a `$stmt->fetch()` to fetch the array but I don't …()` http://php.net/manual/en/mysqli-result.fetch-assoc.php The issue is here: call_user_func_array(array($stmt…, 'bind_result'), $parameters); while ($stmt->fetch()) { $x=array(); foreach ($row as $key =>… Re: mysql_fetch_assoc($result) problems Programming Web Development by Derice … more information: [URL="http://php.net/manual/en/function.mysql-fetch-assoc.php"]mysql_fetch_assoc()[/URL] I need help to insert image and other data into a MySQL database Programming Web Development by mexabet … the character encoding for the connection $pdo = new PDO("mysql:dbname=" . DB_NAME . ";host=" . DB_SERVER, DB_USERNAME, DB_PASSWORD);…pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC); // set default fetch mode to assoc so that you don't have to explicitly list… Re: Error in echoing mysql left outer join results Programming Web Development by cereal … the same column name `tableA_id`, since you're fetching as assoc, it will create an array in which the first index…->fetchAll(); print_r($result); It will return both numeric and assoc index keys, so `tableA_id` index key will be empty, the… Re: I need help to insert image and other data into a MySQL database Programming Web Development by diafol The PDO way would be something like this: $stmt = $db->prepare($sql); $stmt->execute($params); The fetch method is up to you, e.g. $data = $stmt->fetchAll(); Re: I need help to insert image and other data into a MySQL database Programming Web Development by mexabet The mysql query I originally had on add-category.php was this: $… Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL Programming Web Development by GraficRegret shouldn't this while(($row=mysql_fetch_assoc($resource))!==false) read in stead while(($row=mysql_fetch_array($resource))!==false) I am not posative on this, I am stil pretty new to php, however I have not seen the assoc function used before, have only ever seen the $row use the fetch array PHP Framework and Fetch Assoc Programming Web Development by joshmac I am using a framework, and I am having an issue with getting the results of this particular associative array. All others work except for this one and I am not sure why. This one only returns one result. Here is what I have in my model: public function listStats($id) { $sql = DB::inst()->query( "SELECT * FROM ".… Re: PHP Framework and Fetch Assoc Programming Web Development by veedeoo Hi, What framework are you using? can you var_dump or print_r this ? listStats($id); and this $this->listStats what do you get? I am assuming that $this->listStats is a method of the view class? Re: PHP Framework and Fetch Assoc Programming Web Development by veedeoo try this first... put this before the closing bracket of the method listStats;; return $data; } // closing bracket of method listStats.. like this .. public function listStats($id) { $sql = DB::inst()->query( "SELECT * FROM ". TP."tracking WHERE mID = '$id' GROUP … Re: PHP Framework and Fetch Assoc Programming Web Development by cereal Also, since you are querying a specific `mID` and then grouping by the same field, it's correct to get just a row. So try to change the `GROUP BY` clause. Bye! Re: PHP Framework and Fetch Assoc Programming Web Development by joshmac HMM, the GROUP BY was a later addition because it wasn't working, but removing it makes it work now. Thanks. Re: three dimensional arrays Programming Web Development by digital-ether …the format you specify. In fact (to my knowledge) mysql (and thus php) only returns 1 dimensional arrays, …arrays: [url]http://us2.php.net/manual/en/function.mysql-fetch-assoc.php[/url] If you prefer objects: [url]http://us2….php.net/manual/en/function.mysql-fetch-object.php[/url] (returns the default php object (new… Re: Two tables, one loop, and a hell of trouble Programming Web Development by SimonMayer … the [URL="http://us.php.net/manual/en/function.mysql-fetch-assoc.php"]mysql_fetch_assoc[/URL] page: [QUOTE]// While a row of… Re: Two tables, one loop, and a hell of trouble Programming Web Development by somedude3488 … the [URL="http://us.php.net/manual/en/function.mysql-fetch-assoc.php"]mysql_fetch_assoc[/URL] page: I am not sure why… Re: assign multiple vaules into variable Programming Web Development by vibhaJ If you are fetching records from database you can directly get values using mysql_fetch_assoc. [URL="http://in.php.net/manual/en/function.mysql-fetch-assoc.php#example-1472"]example link[/URL] Re: Unable to 'echo' my result Programming Web Development by |-|x [mysql_query](http://php.net/manual/en/function.mysql-query.php) returns a [resource](http://www.php.net/manual/….php) or [mysql_fetch_assoc](http://www.php.net/manual/en/function.mysql-fetch-assoc.php) passing the `$result` to that function, which will return… Re: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given Programming Web Development by Squidge Have a look here: `http://php.net/manual/en/function.mysql-fetch-assoc.php` $image seem's to be very popular variable, the … fetch_assoc and fetch_object problem Programming Web Development by jacobus8 …brand new to PHP, MySQL and Apache but I have…already. I've got PHP, MySQL and Apache installed and everything …query is ok.</p>"; /* fetch assoc array while ($row = $result->fetch_assoc…: "; echo stripslashes($row['isbn']); } */ /* fetch object array while ($obj = $result->fetch_object()) … Re: fetch_assoc and fetch_object problem Programming Web Development by jacobus8 …gt;"; $row = $result->fetch_assoc(); // fetch assoc array one time only if ($mysqli->errno) …{ echo "fetch error: ".$mysqli->error; } /* free…$mysqli->close(); ?> [/code] What about MySQL configuration files? Should I look for potential issues there?…