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!
i need to be able to pull get data from a mysql database and put it inot an array. then i need to search that array for a string... iv tried using the mysql_fetch_array and stuff but i wont work like i need it to...
@mysql_connect($dbhost,$dbuser,$dbpass);
@mysql_select_db($dbname) or die("No db");
$query = "SELECT user FROM status";
$result = mysql_query($query);
$users = mysql_num_rows($result);
for($i=0; $i<$users; $i++){
$row[] = mysql_fetch_assoc($result);
}
//you now have a 2D array that you can do your checks on
In the future, please make your thread titles more informative, and use
shoxlx wrote:then i need to search that array for a string
use in_array() if the complete string is an element in the 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.