Guest User

Untitled

a guest
Jun 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. $q4 = "SELECT domain_name,slots_config.bid FROM slots_pid,slots_config,slots_sites
  2. WHERE slots_config.bid=slots_pid.bid && slots_sites.aid=slots_pid.aid";
  3. $result4 = mysql_query($q4);
  4.  
  5. while($row = mysql_fetch_array($result4))
  6. {
  7. $resultarray[] = $row;
  8. }
  9.  
  10.  
  11. if (in_array("test",$resultarray))
  12. {
  13. echo "Match found";
  14. }
  15. else
  16. {
  17. echo "Match not found";
  18. }
  19.  
  20. $resultarray[0]['domain_name'] = 'first row domain name';
  21. $resultarray[0]['bid'] = 'first row bid';
  22. $resultarray[1]['domain_name'] = 'second row domain name';
  23. ...
  24.  
  25. $q4 = "SELECT domain_name,slots_config.bid FROM slots_pid,slots_config,slots_sites
  26. WHERE slots_config.bid=slots_pid.bid && slots_sites.aid=slots_pid.aid";
  27. $result4 = mysql_query($q4);
  28.  
  29. while($row = mysql_fetch_array($result4))
  30. {
  31. if (in_array("test",$row))
  32. {
  33. echo "Match found";
  34. }
  35. else
  36. {
  37. echo "Match not found";
  38. }
  39. }
  40.  
  41. $found = false;
  42. while($row = mysql_fetch_array($result4))
  43. {
  44. if (in_array($needle, $row){
  45. print "here it is";
  46. $found = true;
  47. break;
  48. }
  49.  
  50. if (!$found) {
  51. print "not found";
  52. }
Add Comment
Please, Sign In to add comment