Hello, have what may be a simple question for some of you. I have an sql query which searches a database for a name that is inputted with a html form. This is al working fine with the following query: $query = "SELECT * FROM `data` WHERE `name` LIKE CONVERT( _utf8 '$name' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0 , 30 "; PHP: This is returning the name from the database just fine, the problem is I am not getting it to display the rest of the values in that row. Is there any way to return everything as an array perhaps?
There are several ways to get the array. Here is one example of what you can do: php code: $result = mysql_query($query); while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { printf ("ID: %s Name: %s", $row[0], $row["name"]); } mysql_free_result($result); Code (markup): In the while loop, you can treat the results as an array. Either a numerical array or associated array..
Thanks, I forgot to use the code of $row[column name goes here] to display the other data. Got it working now. Thanks!