-6

I have this php script

<?php
                    include ("db.php");
                    $result = mysql_query("SELECT fbuid from fbusers");
                    while($array = mysql_fetch_array ($result)){                            
                    print("alert ($array[0]);");
                                                                   }
 ?>

I want to store the returned values in a javascript variable or array so I can check if a fb user it's already registered in my app. Could somebody tell me how could I store the mysql_fetch_array to javascript?

user1820705
  • 591
  • 2
  • 7
  • 17
  • http://stackoverflow.com/questions/168214/pass-a-php-string-to-a-javascript-variable-and-escape-newlines – Hariharan Jul 15 '13 at 10:17

1 Answers1

1

you can always create a div use your php code that has an unique id and concatenate all your $arrays in the div, then just use something like the following in javascript to get your values

var x=document.getElementById("your_div_id");
alert(x.innerHTML);

  

David Zhan Liu
  • 474
  • 5
  • 8